diff options
author | Juha Vehviläinen <jusu@users.sourceforge.net> | 2002-12-30 22:14:47 +0000 |
---|---|---|
committer | Juha Vehviläinen <jusu@users.sourceforge.net> | 2002-12-30 22:14:47 +0000 |
commit | aa901783a0dc07f0dc08628d3ca091a9164b0629 (patch) | |
tree | 175410946332fe359c01f945dce6dd3a401e7747 | |
parent | d80c69296266a6169c0164467b748f197e11d25b (diff) |
*** empty log message ***
svn path=/trunk/Framestein/; revision=312
-rw-r--r-- | CHANGELOG.txt | 2 | ||||
-rwxr-xr-x | Framestein.exe | bin | 912384 -> 970240 bytes | |||
-rw-r--r-- | Patches/05.example-plugins.pd | 5 | ||||
-rw-r--r-- | Patches/fs.grid.pd | 30 | ||||
-rw-r--r-- | Patches/fs.main.pd | 22 | ||||
-rw-r--r-- | Patches/xop.pd | 13 | ||||
-rw-r--r-- | Plugins/2colors.cpp | 2 | ||||
-rw-r--r-- | Plugins/2colors.dll | bin | 28672 -> 36864 bytes | |||
-rw-r--r-- | Plugins/argument-passing.cpp | 8 | ||||
-rw-r--r-- | Plugins/argument-passing.dll | bin | 40960 -> 40960 bytes | |||
-rw-r--r-- | Plugins/black.c | 3 | ||||
-rw-r--r-- | Plugins/black.dll | bin | 28672 -> 36864 bytes | |||
-rw-r--r-- | Plugins/gol.c | 2 | ||||
-rw-r--r-- | Plugins/gol.dll | bin | 36864 -> 36864 bytes | |||
-rw-r--r-- | Plugins/green.cpp | 2 | ||||
-rw-r--r-- | Plugins/green.dll | bin | 28672 -> 36864 bytes | |||
-rw-r--r-- | Plugins/hist.cpp | 2 | ||||
-rw-r--r-- | Plugins/hist.dll | bin | 45056 -> 45056 bytes | |||
-rw-r--r-- | Plugins/makefile | 7 | ||||
-rw-r--r-- | Plugins/plugin.h | 4 | ||||
-rw-r--r-- | Plugins/rgb.c | 2 | ||||
-rw-r--r-- | Plugins/rgb.dll | bin | 36864 -> 36864 bytes | |||
-rw-r--r-- | Plugins/shuffle.c | 2 | ||||
-rw-r--r-- | Plugins/shuffle.dll | bin | 28672 -> 36864 bytes | |||
-rw-r--r-- | Plugins/sonogram.cpp | 3 | ||||
-rw-r--r-- | Plugins/sonogram.dll | bin | 45056 -> 49152 bytes | |||
-rw-r--r-- | Plugins/subtract.cpp | 2 | ||||
-rw-r--r-- | Plugins/subtract.dll | bin | 40960 -> 40960 bytes | |||
-rw-r--r-- | Plugins/tile.cpp | 2 | ||||
-rw-r--r-- | Plugins/tile.dll | bin | 28672 -> 36864 bytes | |||
-rw-r--r-- | README.txt | 6 | ||||
-rw-r--r-- | Source/Framestein.cfg | 1 | ||||
-rw-r--r-- | Source/Framestein.dof | 5 | ||||
-rw-r--r-- | Source/Framestein.dpr | 4 | ||||
-rw-r--r-- | Source/mainunit.dfm | 6 | ||||
-rw-r--r-- | Source/mainunit.pas | 10 | ||||
-rw-r--r-- | Source/pluginunit.pas | 29 | ||||
-rw-r--r-- | Source/toolbarunit.dfm | 104 | ||||
-rw-r--r-- | Source/toolbarunit.pas | 136 |
39 files changed, 394 insertions, 20 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt index f74fe8c..c737d7e 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,4 +1,5 @@ 0.32 +- added toolbar, paste objects to patches - new plugin: lightspeed - fs.frame: |title this is the main window( and |undock( commands - fs.copy: transcolor <r> <g> <b> to set the transparent color @@ -17,6 +18,7 @@ - added line width setting to fs.draw - fix: border_0 no longer alters frame dimensions +- preventing lockups-feature to fs.main.pd 0.31 - added plugins by Olaf Matthes: PeRColate and PixelPack. Thanks, Olaf! diff --git a/Framestein.exe b/Framestein.exe Binary files differindex a7622fb..a288d08 100755 --- a/Framestein.exe +++ b/Framestein.exe diff --git a/Patches/05.example-plugins.pd b/Patches/05.example-plugins.pd index 630514e..4a46af1 100644 --- a/Patches/05.example-plugins.pd +++ b/Patches/05.example-plugins.pd @@ -1,8 +1,8 @@ -#N canvas 106 10 880 659 12; +#N canvas 106 10 882 661 12; #X obj 11 41 fs.main; #X msg 11 11 6001; #X msg 62 12 reset; -#X text 157 37 Using Plugins; +#X text 159 40 Using Plugins; #X obj 65 224 fs.framed plugins; #X msg 209 225 76 + 446; #X msg 34 95 noize; @@ -23,6 +23,7 @@ operation.; #X msg 209 289 xbend 40 140; #X obj 321 359 init; #X obj 284 225 init; +#X text 160 591 See the Plugins-dir for more.; #X connect 1 0 0 0; #X connect 1 0 2 0; #X connect 2 0 0 1; diff --git a/Patches/fs.grid.pd b/Patches/fs.grid.pd new file mode 100644 index 0000000..2819a1e --- /dev/null +++ b/Patches/fs.grid.pd @@ -0,0 +1,30 @@ +#N canvas 290 97 559 504 12; +#X obj 167 176 init; +#X obj 111 267 unpack f f f f; +#X obj 190 303 / 176; +#X obj 237 303 / 144; +#X obj 237 328 xop - 1; +#X text 18 44 args: <x-max> <y-max> <window to dock to>; +#X msg 167 203 mousetrack_1 \, mouserect_1; +#X obj 190 437 outlet; +#X obj 247 437 outlet; +#X obj 325 437 outlet; +#X obj 190 328 * \$1; +#X obj 237 353 * \$2; +#X obj 66 237 fs.framed \$3; +#X obj 66 179 inlet; +#X text 18 72 inlets: to fs.frame; +#X text 18 88 outlets: x \, y \, fs.frame 3rd outlet; +#X text 18 14 fs.grid -- grid control module; +#X connect 0 0 6 0; +#X connect 1 2 2 0; +#X connect 1 3 3 0; +#X connect 2 0 10 0; +#X connect 3 0 4 0; +#X connect 4 0 11 0; +#X connect 6 0 12 0; +#X connect 10 0 7 0; +#X connect 11 0 8 0; +#X connect 12 1 1 0; +#X connect 12 2 9 0; +#X connect 13 0 12 0; diff --git a/Patches/fs.main.pd b/Patches/fs.main.pd index a86c338..4ce265d 100644 --- a/Patches/fs.main.pd +++ b/Patches/fs.main.pd @@ -1,4 +1,4 @@ -#N canvas 278 0 710 499 12; +#N canvas 278 0 720 628 12; #X floatatom 27 322 4 0 0; #X obj 207 160 loadbang; #X msg 206 254 disconnect; @@ -13,10 +13,10 @@ #X text 439 42 reset; #X obj 393 132 t b b; #X msg 428 158 send reset; -#X obj 157 382 pack s f; +#X obj 280 409 pack s f; #X floatatom 272 378 4 0 0; #X text 10 7 fs.main - handles communication with Framestein.; -#X msg 157 411 \; \$1 \$2; +#X msg 280 433 \; \$1 \$2; #X text 149 291 you can run framestein and the control-patches on separate machines by changing "localhost" to "your.windows.slave" above and configuring fs likewise (right-click fs).; @@ -32,6 +32,15 @@ configuring fs likewise (right-click fs).; #X obj 530 207 r fs_reset; #X msg 207 185 6001; #X obj 27 293 netsend; +#X msg 159 551 ping; +#X obj 159 576 print fs.main; +#X text 152 484 this can be used to resolve lockups: mark an area in +pd console \, after a while pd will stop sending commands to fs.; +#X msg 137 439 \; \$1 \$2 \$3 \$4 \$5; +#X obj 137 416 pack s s f f s; +#X obj 157 382 route obj; +#X obj 159 526 fps 0; +#X text 209 525 change to 0.1 to turn it on; #X connect 1 0 29 0; #X connect 2 0 30 0; #X connect 3 0 30 0; @@ -46,8 +55,13 @@ configuring fs likewise (right-click fs).; #X connect 14 0 17 0; #X connect 20 0 12 0; #X connect 20 1 21 0; -#X connect 22 0 14 0; +#X connect 22 0 36 0; #X connect 22 1 15 0; #X connect 23 0 30 0; #X connect 29 0 23 0; #X connect 30 0 0 0; +#X connect 31 0 32 0; +#X connect 35 0 34 0; +#X connect 36 0 35 0; +#X connect 36 1 14 0; +#X connect 37 0 31 0; diff --git a/Patches/xop.pd b/Patches/xop.pd new file mode 100644 index 0000000..b02df33 --- /dev/null +++ b/Patches/xop.pd @@ -0,0 +1,13 @@ +#N canvas 142 281 462 312 12; +#X obj 207 56 inlet; +#X obj 207 99 t b f; +#X obj 223 223 outlet; +#X obj 223 179 \$1; +#X obj 207 136 f \$2; +#X obj 301 56 inlet; +#X connect 0 0 1 0; +#X connect 1 0 4 0; +#X connect 1 1 3 1; +#X connect 3 0 2 0; +#X connect 4 0 3 0; +#X connect 5 0 4 1; diff --git a/Plugins/2colors.cpp b/Plugins/2colors.cpp index b76be62..e594c2b 100644 --- a/Plugins/2colors.cpp +++ b/Plugins/2colors.cpp @@ -19,3 +19,5 @@ void perform_effect(_frame f, _args a) p.next(); } } + +INFO("go black and white") diff --git a/Plugins/2colors.dll b/Plugins/2colors.dll Binary files differindex ba62b0f..fbb0e4d 100644 --- a/Plugins/2colors.dll +++ b/Plugins/2colors.dll diff --git a/Plugins/argument-passing.cpp b/Plugins/argument-passing.cpp index d89e8c1..0247b5f 100644 --- a/Plugins/argument-passing.cpp +++ b/Plugins/argument-passing.cpp @@ -1,9 +1,11 @@ +#include "plugin.h" +#include "pixels.h" + // -// example of parsing arguments in a plugin using the arguments-class (defined in pixels.h) +INFO("example of parsing arguments in a plugin using the arguments-class") +// (defined in pixels.h) // -#include "pixels.h" - void perform_effect(_frame f, _args a) { arguments ar(a.s); diff --git a/Plugins/argument-passing.dll b/Plugins/argument-passing.dll Binary files differindex dfa112e..d77a64b 100644 --- a/Plugins/argument-passing.dll +++ b/Plugins/argument-passing.dll diff --git a/Plugins/black.c b/Plugins/black.c index 3716767..dbb672f 100644 --- a/Plugins/black.c +++ b/Plugins/black.c @@ -1,6 +1,8 @@ #include <stdlib.h> #include "plugin.h" +INFO("total blackness") + void perform_effect(_frame f, _args a) { memset(f.bits, 0, f.height*f.lpitch); @@ -11,3 +13,4 @@ void perform_copy(_frame f1, _frame f2, _args a) memset(f1.bits, 0, f1.height*f1.lpitch); memset(f2.bits, 0, f2.height*f2.lpitch); } + diff --git a/Plugins/black.dll b/Plugins/black.dll Binary files differindex cb8b57a..474d5ef 100644 --- a/Plugins/black.dll +++ b/Plugins/black.dll diff --git a/Plugins/gol.c b/Plugins/gol.c index 3349df2..222a894 100644 --- a/Plugins/gol.c +++ b/Plugins/gol.c @@ -11,6 +11,8 @@ #define BORN 1 #define DYING 2 +INFO("Conway's Game Of Life") + int aroundme(_frame f, int x, int y) { pixel16 *p; diff --git a/Plugins/gol.dll b/Plugins/gol.dll Binary files differindex 611f227..26fe8e9 100644 --- a/Plugins/gol.dll +++ b/Plugins/gol.dll diff --git a/Plugins/green.cpp b/Plugins/green.cpp index c66e3e6..53f58e5 100644 --- a/Plugins/green.cpp +++ b/Plugins/green.cpp @@ -12,3 +12,5 @@ void perform_effect(_frame f, _args a) p.next(); } } + +INFO("go green") diff --git a/Plugins/green.dll b/Plugins/green.dll Binary files differindex 3dc1016..d1f42d6 100644 --- a/Plugins/green.dll +++ b/Plugins/green.dll diff --git a/Plugins/hist.cpp b/Plugins/hist.cpp index f525db1..84c6a6e 100644 --- a/Plugins/hist.cpp +++ b/Plugins/hist.cpp @@ -13,6 +13,8 @@ #include "plugin.h" #include "pixels.h" +INFO("helper for fs.hist") + void perform_effect(_frame f, _args a) { if(!a.s) return; diff --git a/Plugins/hist.dll b/Plugins/hist.dll Binary files differindex 7c0bc44..30937b8 100644 --- a/Plugins/hist.dll +++ b/Plugins/hist.dll diff --git a/Plugins/makefile b/Plugins/makefile index dd1b028..f4e6b6c 100644 --- a/Plugins/makefile +++ b/Plugins/makefile @@ -15,9 +15,10 @@ all: noize colortv subtract xbend bend gol shuffle green \ FLAGS = /LD /Gd /GD /Ox -EFFECT = /export:perform_effect -COPY = /export:perform_copy -BOTH = /export:perform_effect /export:perform_copy +# does this suck or what? how to do it better? +EFFECT = /export:info /export:perform_effect +COPY = /export:info /export:perform_copy +BOTH = /export:info /export:perform_effect /export:perform_copy noize: cl noize.c $(FLAGS) /link $(BOTH) diff --git a/Plugins/plugin.h b/Plugins/plugin.h index 00281e5..69ed298 100644 --- a/Plugins/plugin.h +++ b/Plugins/plugin.h @@ -133,4 +133,8 @@ __inline byte klamp601(long in) return(out); } +// use this to easily describe your plugins: + +#define INFO(x) void info(char *s) { sprintf(s, x); } + #endif // #ifndef _PLUGINH diff --git a/Plugins/rgb.c b/Plugins/rgb.c index d58f784..ebe9c38 100644 --- a/Plugins/rgb.c +++ b/Plugins/rgb.c @@ -1,6 +1,8 @@ #include <string.h> #include "plugin.h" +INFO("helper for fs.rgb") + void perform_effect(_frame f, _args a) { char *t; diff --git a/Plugins/rgb.dll b/Plugins/rgb.dll Binary files differindex ba7dfd2..76e18b7 100644 --- a/Plugins/rgb.dll +++ b/Plugins/rgb.dll diff --git a/Plugins/shuffle.c b/Plugins/shuffle.c index 0604595..e4254fa 100644 --- a/Plugins/shuffle.c +++ b/Plugins/shuffle.c @@ -1,6 +1,8 @@ #include <string.h> #include "plugin.h" +INFO("randomly move around pixels") + void perform_effect(_frame f, _args a) { int i, o=1000, x1, y1, x2, y2, range=10; diff --git a/Plugins/shuffle.dll b/Plugins/shuffle.dll Binary files differindex bd5d552..d46d5aa 100644 --- a/Plugins/shuffle.dll +++ b/Plugins/shuffle.dll diff --git a/Plugins/sonogram.cpp b/Plugins/sonogram.cpp index 821b94a..68c86fe 100644 --- a/Plugins/sonogram.cpp +++ b/Plugins/sonogram.cpp @@ -18,6 +18,8 @@ #define SONOMAXVAL 500 #define sonotype float +INFO("helper for fs.sonogram") + int callcount=-1; void perform_effect(_frame f, _args a) @@ -80,3 +82,4 @@ void perform_effect(_frame f, _args a) } } } + diff --git a/Plugins/sonogram.dll b/Plugins/sonogram.dll Binary files differindex db6e132..2615d14 100644 --- a/Plugins/sonogram.dll +++ b/Plugins/sonogram.dll diff --git a/Plugins/subtract.cpp b/Plugins/subtract.cpp index 3172513..a088146 100644 --- a/Plugins/subtract.cpp +++ b/Plugins/subtract.cpp @@ -13,6 +13,8 @@ #include "plugin.h" #include "pixels.h" +INFO("subtract color components"); + void perform_effect(_frame f, _args a) { arguments ar(a.s); diff --git a/Plugins/subtract.dll b/Plugins/subtract.dll Binary files differindex 65383b3..4bab85c 100644 --- a/Plugins/subtract.dll +++ b/Plugins/subtract.dll diff --git a/Plugins/tile.cpp b/Plugins/tile.cpp index 47fa5ca..dd584af 100644 --- a/Plugins/tile.cpp +++ b/Plugins/tile.cpp @@ -3,6 +3,8 @@ #include "plugin.h" #include "pixels.h" +INFO("duplicate image to multiple rows and columns") + void perform_copy(_frame f1, _frame f2, _args a) { pixels px(f2); diff --git a/Plugins/tile.dll b/Plugins/tile.dll Binary files differindex 58a8886..7d7e565 100644 --- a/Plugins/tile.dll +++ b/Plugins/tile.dll @@ -20,7 +20,7 @@ to tell Pd where to find Framestein's abstractions and externals. LICENCE -Copyright (c) 2001-2002 Juha Vehviläinen. +Copyright (c) 2001-2003 Juha Vehviläinen. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -39,8 +39,8 @@ Juha Vehviläinen, jusu@iki.fi "Framestein" name and logo: Vesa Vehviläinen -Pink Twins (http://pinktwins.com) are making some heavy use of Framestein. -Check their site! +Pink Twins (http://pinktwins.com) are using Framestein for all their videos. +Check that site! Plugins by Olaf Matthes: http://www.akustische-kunst.de/puredata/framestein/framestein.html diff --git a/Source/Framestein.cfg b/Source/Framestein.cfg index 6ee2f15..d487870 100644 --- a/Source/Framestein.cfg +++ b/Source/Framestein.cfg @@ -31,6 +31,7 @@ -M -$M16384,1048576 -K$00400000 +-E"e:\fs\Framestein" -LE"c:\program files\borland\delphi5\Projects\Bpl" -LN"c:\program files\borland\delphi5\Projects\Bpl" -U"E:\lab\common\DelphiX2000_0717-2\Source;E:\lab\common\fastlib;E:\lab\common\pshost;E:\lab\common\G32" diff --git a/Source/Framestein.dof b/Source/Framestein.dof index ddd0c6f..26929b1 100644 --- a/Source/Framestein.dof +++ b/Source/Framestein.dof @@ -39,7 +39,7 @@ MaxStackSize=1048576 ImageBase=4194304 ExeDescription= [Directories] -OutputDir= +OutputDir=e:\fs\Framestein UnitOutputDir= PackageDLLOutputDir= PackageDCPOutputDir= @@ -90,3 +90,6 @@ Item1=E:\lab\common\DelphiX2000_0717-2\Source;E:\lab\common\fastlib;E:\lab\commo Item2=E:\lab\common\DelphiX2000_0717-2\Source;E:\lab\common\fastlib;E:\lab\common\pshost Item3=E:\lab\common\DelphiX2000_0717-2\Source;E:\lab\common\fastlib Item4=E:\lab\common\DelphiX2000_0717-2\Source +[HistoryLists\hlOutputDirectorry] +Count=1 +Item0=e:\fs\Framestein diff --git a/Source/Framestein.dpr b/Source/Framestein.dpr index f280e75..009543a 100644 --- a/Source/Framestein.dpr +++ b/Source/Framestein.dpr @@ -17,7 +17,8 @@ uses logunit in 'logunit.pas' {log},
pluginunit in 'pluginunit.pas',
progressunit in 'progressunit.pas' {Progress},
- configureunit in 'configureunit.pas' {configure};
+ configureunit in 'configureunit.pas' {configure},
+ toolbarunit in 'toolbarunit.pas' {toolbar};
{$R *.RES}
@@ -28,6 +29,7 @@ begin Application.CreateForm(TProgress, Progress);
Application.CreateForm(Tconfigure, configure);
Application.CreateForm(Tlog, log);
+ Application.CreateForm(Ttoolbar, toolbar);
Application.Run;
end.
diff --git a/Source/mainunit.dfm b/Source/mainunit.dfm index 46a9252..f5d438e 100644 --- a/Source/mainunit.dfm +++ b/Source/mainunit.dfm @@ -3505,8 +3505,12 @@ object main: Tmain Caption = 'Reload plugins' OnClick = MiReloadPluginsClick end + object MiToolbar: TMenuItem + Caption = 'Show Toolbar' + OnClick = MiToolbarClick + end object MiLog: TMenuItem - Caption = 'Show debug' + Caption = 'Show Debug' OnClick = MiLogClick end object MiExit: TMenuItem diff --git a/Source/mainunit.pas b/Source/mainunit.pas index 1b2a6e1..aebb64b 100644 --- a/Source/mainunit.pas +++ b/Source/mainunit.pas @@ -34,6 +34,7 @@ type csToPd: TClientSocket;
MiExit: TMenuItem;
REConsole: TRichEdit;
+ MiToolbar: TMenuItem;
procedure ss1ClientRead(Sender: TObject; Socket: TCustomWinSocket);
procedure FormCreate(Sender: TObject);
procedure ss1ClientError(Sender: TObject; Socket: TCustomWinSocket;
@@ -63,6 +64,7 @@ type procedure MiExitClick(Sender: TObject);
procedure ImageLogoDblClick(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
+ procedure MiToolbarClick(Sender: TObject);
private
{ Private declarations }
SocketMem: Pointer;
@@ -142,7 +144,7 @@ uses fscopyunit, fstextunit, fsdrawunit, fsbrowserunit,
fsinfounit, fsaviunit,
fastfiles,
- Strz, logunit, configureunit, progressunit;
+ Strz, logunit, configureunit, progressunit, toolbarunit;
{$IFDEF FSDLL}
procedure TMainThread.Execute;
@@ -944,5 +946,11 @@ begin {$ENDIF}
end;
+procedure Tmain.MiToolbarClick(Sender: TObject);
+begin
+ MiToolbar.Checked := not MiToolbar.Checked;
+ Toolbar.Visible := MiToolbar.Checked;
+end;
+
end.
diff --git a/Source/pluginunit.pas b/Source/pluginunit.pas index ddee99c..f331ed8 100644 --- a/Source/pluginunit.pas +++ b/Source/pluginunit.pas @@ -32,18 +32,21 @@ type const ret: PChar
); cdecl;
+ TInfoProc = procedure(const str: PChar); cdecl;
+
TPointerList = TList;
TLibraryList = TList;
TPlugins = class(TComponent)
private
- Names: TStringList;
EffectProcs: TPointerList;
CopyProcs: TPointerList;
+ InfoProcs: TPointerList;
Libs: TLibraryList;
procedure LoadHandleFile(const SearchRec: TSearchRec;
const FullPath: String);
public
+ Names: TStringList;
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure Load;
@@ -56,6 +59,7 @@ type function CallCopy(const d1: TDirectDrawSurface;
const d2: TDirectDrawSurface;
const procIndex: Integer; const args: String): Boolean;
+ function Info(const procIndex: Integer): String;
end;
implementation
@@ -70,6 +74,7 @@ type const
EffectProcName = 'perform_effect';
CopyProcName = 'perform_copy';
+ InfoProcName = 'info';
{ TPlugins }
@@ -79,6 +84,7 @@ begin Names := TStringList.Create;
EffectProcs := TPointerList.Create;
CopyProcs := TPointerList.Create;
+ InfoProcs := TPointerList.Create;
Libs := TLibraryList.Create;
end;
@@ -114,6 +120,7 @@ var b: array[0..255] of Char;
EffectProc: TEffectProc;
CopyProc: TCopyProc;
+ InfoProc: TInfoProc;
s: String;
i: Integer;
begin
@@ -123,12 +130,14 @@ begin if h<>0 then begin
@EffectProc := GetProcAddress(h, EffectProcName);
@CopyProc := GetProcAddress(h, CopyProcName);
+ @InfoProc := GetProcAddress(h, InfoProcName);
s := ExtractFileName(FullPath);
i := Pos('.DLL', UpperCase(s));
if i>0 then Delete(s, i, 255);
Names.Add(s);
EffectProcs.Add(@EffectProc);
CopyProcs.Add(@CopyProc);
+ InfoProcs.Add(@InfoProc);
Libs.Add(@h);
end;
end;
@@ -217,5 +226,23 @@ begin Result := True;
end;
+function TPlugins.Info(const procIndex: Integer): String;
+var
+ Proc: TInfoProc;
+ buf: array[0..255] of Char;
+ p: PChar;
+begin
+ if (procIndex=-1) or (procIndex>=InfoProcs.Count) then Exit;
+ @Proc := InfoProcs[procIndex];
+ if @Proc=nil then begin
+ Result := '';
+ Exit;
+ end;
+ buf[0]:=#0;
+ p := @buf;
+ Proc(p);
+ Result := StrPas(p);
+end;
+
end.
diff --git a/Source/toolbarunit.dfm b/Source/toolbarunit.dfm new file mode 100644 index 0000000..5cd6673 --- /dev/null +++ b/Source/toolbarunit.dfm @@ -0,0 +1,104 @@ +object toolbar: Ttoolbar + Left = 264 + Top = 454 + Width = 567 + Height = 282 + BorderStyle = bsSizeToolWin + Caption = 'Toolbar' + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + OnCreate = FormCreate + PixelsPerInch = 96 + TextHeight = 13 + object Splitter1: TSplitter + Left = 0 + Top = 97 + Width = 559 + Height = 6 + Cursor = crVSplit + Align = alTop + Beveled = True + end + object Panel1: TPanel + Left = 0 + Top = 103 + Width = 559 + Height = 133 + Align = alClient + BevelOuter = bvNone + Caption = 'Panel1' + TabOrder = 0 + object LVFilters: TListView + Left = 0 + Top = 0 + Width = 559 + Height = 133 + Align = alClient + BorderStyle = bsNone + Color = clBtnFace + Columns = < + item + AutoSize = True + Caption = 'Name' + end + item + AutoSize = True + Caption = 'Info' + end> + ReadOnly = True + TabOrder = 0 + ViewStyle = vsList + OnChange = LVFiltersChange + OnCustomDrawItem = LVFiltersCustomDrawItem + OnSelectItem = LVFiltersSelectItem + end + end + object Panel2: TPanel + Left = 0 + Top = 0 + Width = 559 + Height = 97 + Align = alTop + BevelOuter = bvNone + Caption = 'Panel2' + TabOrder = 1 + object LVTools: TListView + Left = 0 + Top = 0 + Width = 559 + Height = 97 + Align = alClient + BorderStyle = bsNone + Color = clBtnFace + Columns = <> + ReadOnly = True + TabOrder = 0 + ViewStyle = vsList + OnChange = LVFiltersChange + OnCustomDrawItem = LVFiltersCustomDrawItem + OnSelectItem = LVToolsSelectItem + end + object m1: TMemo + Left = 144 + Top = 8 + Width = 129 + Height = 33 + TabOrder = 1 + Visible = False + WordWrap = False + end + end + object bar: TStatusBar + Left = 0 + Top = 236 + Width = 559 + Height = 19 + Panels = <> + SimplePanel = False + end +end diff --git a/Source/toolbarunit.pas b/Source/toolbarunit.pas new file mode 100644 index 0000000..5449b53 --- /dev/null +++ b/Source/toolbarunit.pas @@ -0,0 +1,136 @@ +unit toolbarunit; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + ComCtrls, ToolWin, Buttons, ExtCtrls, StdCtrls, ImgList; + +type + Ttoolbar = class(TForm) + Panel1: TPanel; + LVFilters: TListView; + Panel2: TPanel; + LVTools: TListView; + Splitter1: TSplitter; + bar: TStatusBar; + m1: TMemo; + procedure FormCreate(Sender: TObject); + procedure LVFiltersCustomDrawItem(Sender: TCustomListView; + Item: TListItem; State: TCustomDrawState; var DefaultDraw: Boolean); + procedure LVFiltersChange(Sender: TObject; Item: TListItem; + Change: TItemChange); + procedure LVFiltersSelectItem(Sender: TObject; Item: TListItem; + Selected: Boolean); + procedure LVToolsSelectItem(Sender: TObject; Item: TListItem; + Selected: Boolean); + private + { Private declarations } + public + { Public declarations } + end; + +var + toolbar: Ttoolbar; + +implementation + +uses + mainunit, strz; + +{$R *.DFM} + +procedure Ttoolbar.FormCreate(Sender: TObject); +var + i: Integer; +begin + // Load tools + if FileExists(main.FSFolder+'\toolbar.txt') then begin + m1.Lines.LoadFromFile(main.FSFolder+'\toolbar.txt'); + if m1.Lines.Count>0 then + for i:=0 to m1.Lines.Count-1 do begin + with LVTools.Items.Add do begin + Caption := ExtractWord(1, m1.Lines[i], [' ']); + Data := Pointer(i); + end; + end; + end; + + // Load filters + if main.Plugins.Names.Count>0 then + for i:=0 to main.Plugins.Names.Count-1 do begin + with LVFilters.Items.Add do begin + Caption := main.Plugins.Names[i]; + SubItems.Add(main.Plugins.Info(i)); + Data := Pointer(i); + end; + end; + Show; +end; + +const + it: TListItem = nil; + +procedure Ttoolbar.LVFiltersChange(Sender: TObject; Item: TListItem; + Change: TItemChange); +begin + if Item.Selected then + it := item; + if Item.ListView.Selected=nil then it:=nil; +end; + +procedure Ttoolbar.LVFiltersCustomDrawItem(Sender: TCustomListView; + Item: TListItem; State: TCustomDrawState; var DefaultDraw: Boolean); +var + Title: array[0..255] of Char; + s, cmd: String; + h: THandle; +begin + if (it=nil) or (Item.Caption='') then Exit; + if it.Caption=item.Caption then begin + Sleep(50); // wait for pd window to get focus + h := GetForegroundWindow; + if GetWindowText(h, Title, SizeOf(Title))>0 then begin + s := StrPas(@Title); + if Pos(' - ', S)>0 then begin + Delete(S, Pos(' - ', S), 255); + if Pos('*', S)>0 then Delete(S, Pos('*', S), 255); +// main.Post(Item.Caption+' -> '+S); + if Item.ListView=LVFilters then + cmd := 'msg' + else + cmd := 'obj'; + main.SendReturnValues('obj pd-'+S+'='+cmd+' 10 10 '+Item.Caption+';'); + Item.ListView.Selected := nil; + end; + end; + end; +end; + +procedure Ttoolbar.LVFiltersSelectItem(Sender: TObject; Item: TListItem; + Selected: Boolean); +var + S: String; +begin + S := main.Plugins.Info(Integer(Item.Data)); + if S='' then + bar.SimpleText := '<no info available>' + else + bar.SimpleText := Item.Caption+': '+S; +end; + +procedure Ttoolbar.LVToolsSelectItem(Sender: TObject; Item: TListItem; + Selected: Boolean); +var + S: String; + i: Integer; +begin + i := Integer(Item.Data); + if (i>=0) and (i<m1.Lines.Count) then begin + S := m1.Lines[i]; + if Pos(' ', S)>0 then Delete(S, 1, Pos(' ', S)); + bar.SimpleText := S; + end; +end; + +end. |