[CinCV-commits] CinelerraCV.git (#1547) - master (branch) updated: v2.3-95-g21049b7

git repository hosting git at cinelerra-cv.org
Wed Apr 27 17:43:09 CEST 2016


The branch, master has been updated
       via  21049b7c53ab6019383b8be9a0789e6e8c148cb8 (commit)
       via  388c7ae73b1df04440804e75a19d9251f08512d7 (commit)
       via  da861a9c74ef074105445e5b7d18381cbc7ea4fc (commit)
       via  dea81791ce255023290fefabf83f43f5a2b7cfac (commit)
       via  391a3c6db354ff3167c70ababf37e5bf91a81fe9 (commit)
      from  4202a9d2fe9f4238d2c36b668f5b42cfa3e0bdc5 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 21049b7c53ab6019383b8be9a0789e6e8c148cb8
Author: Einar Rünkaru <einarrunkaru at gmail.com>
Date:   Fri Apr 22 22:04:03 2016 +0300

    Use pluginmacros in "Title" plugin

commit 388c7ae73b1df04440804e75a19d9251f08512d7
Author: Einar Rünkaru <einarrunkaru at gmail.com>
Date:   Fri Apr 22 22:57:28 2016 +0300

    Use pluginmacros in "Delay audio" plugin

commit da861a9c74ef074105445e5b7d18381cbc7ea4fc
Author: Einar Rünkaru <einarrunkaru at gmail.com>
Date:   Fri Apr 22 21:26:44 2016 +0300

    Use pluginmacros in "Synthesizer" plugin

commit dea81791ce255023290fefabf83f43f5a2b7cfac
Author: Einar Rünkaru <einarrunkaru at gmail.com>
Date:   Fri Apr 22 18:58:08 2016 +0300

    Use pluginmacros in "HolographicTV" plugin

commit 391a3c6db354ff3167c70ababf37e5bf91a81fe9
Author: Einar Rünkaru <einarrunkaru at gmail.com>
Date:   Thu Apr 21 20:34:46 2016 +0300

    Base PluginAClientWindow on PluginWindow
    
    All plugin windows must base on PluginWindow class

-----------------------------------------------------------------------

Summary of changes:
 cinelerra/pluginaclientlad.C      |  10 ++--
 cinelerra/pluginaclientlad.h      |   3 +-
 plugins/delayaudio/delayaudio.C   | 107 ++++----------------------------------
 plugins/delayaudio/delayaudio.h   |  32 +-----------
 plugins/holo/holo.C               |  35 +++----------
 plugins/holo/holo.h               |  13 +----
 plugins/synthesizer/synthesizer.C | 102 +++---------------------------------
 plugins/synthesizer/synthesizer.h |  24 +--------
 plugins/titler/title.C            |  31 ++---------
 plugins/titler/title.h            |  13 +----
 10 files changed, 42 insertions(+), 328 deletions(-)

The diff of changes is:
diff --git a/cinelerra/pluginaclientlad.C b/cinelerra/pluginaclientlad.C
index ab03403..1402ce9 100644
--- a/cinelerra/pluginaclientlad.C
+++ b/cinelerra/pluginaclientlad.C
@@ -338,15 +338,11 @@ int PluginACLientFreq::handle_event()
 PluginAClientWindow::PluginAClientWindow(PluginAClientLAD *plugin, 
 	int x, 
 	int y)
- : BC_Window(plugin->gui_string, 
+ : PluginWindow(plugin->gui_string,
  	x,
 	y,
 	500, 
-	plugin->config.total_ports * 30 + 60, 
-	500, 
-	plugin->config.total_ports * 30 + 60, 
-	0, 
-	1)
+	plugin->config.total_ports * 30 + 60)
 {
 	this->plugin = plugin;
 }
@@ -481,6 +477,8 @@ void PluginAClientWindow::create_objects()
 	y += 20;
 	sprintf(string, _("License: %s"), server->lad_descriptor->Copyright);
 	add_subwindow(new BC_Title(x, y, string));
+	show_window();
+	flush();
 }
 
 
diff --git a/cinelerra/pluginaclientlad.h b/cinelerra/pluginaclientlad.h
index 59871e7..7b03186 100644
--- a/cinelerra/pluginaclientlad.h
+++ b/cinelerra/pluginaclientlad.h
@@ -27,6 +27,7 @@
 #include "ladspa.h"
 #include "pluginaclient.h"
 #include "pluginaclientlad.inc"
+#include "pluginwindow.h"
 
 
 class PluginAClientConfig
@@ -117,7 +118,7 @@ public:
 };
 
 
-class PluginAClientWindow : public BC_Window
+class PluginAClientWindow : public PluginWindow
 {
 public:
 	PluginAClientWindow(PluginAClientLAD *plugin, 
diff --git a/plugins/delayaudio/delayaudio.C b/plugins/delayaudio/delayaudio.C
index cc854ed..09fecfd 100644
--- a/plugins/delayaudio/delayaudio.C
+++ b/plugins/delayaudio/delayaudio.C
@@ -35,50 +35,34 @@
 #define N_(String) gettext_noop (String)
 
 
-PluginClient* new_plugin(PluginServer *server)
-{
-	return new DelayAudio(server);
-}
+REGISTER_PLUGIN(DelayAudio)
 
 
 DelayAudio::DelayAudio(PluginServer *server)
- : PluginAClient(server),
-	thread(0),
-	defaults(0)
+ : PluginAClient(server)
 {
-	load_defaults();
+	PLUGIN_CONSTRUCTOR_MACRO
 }
 
 DelayAudio::~DelayAudio()
 {
-	if(thread)
-	{
-		thread->window->set_done(0);
-		thread->completion.lock();
-		delete thread;
-	}
-
-	save_defaults();
-	delete defaults;
+	PLUGIN_DESTRUCTOR_MACRO
 }
 
 
-
-VFrame* DelayAudio::new_picon()
-{
-	return new VFrame(picon_png);
-}
+NEW_PICON_MACRO(DelayAudio)
 
 const char* DelayAudio::plugin_title() { return N_("Delay audio"); }
 int DelayAudio::is_realtime() { return 1; }
 
 
-void DelayAudio::load_configuration()
+int DelayAudio::load_configuration()
 {
 	KeyFrame *prev_keyframe;
 	prev_keyframe = get_prev_keyframe(get_source_position());
 	
  	read_data(prev_keyframe);
+	return 0;
 }
 
 int DelayAudio::load_defaults()
@@ -184,29 +168,9 @@ int DelayAudio::process_realtime(int64_t size, double *input_ptr, double *output
 	return 0;
 }
 
-int DelayAudio::show_gui()
-{
-	load_configuration();
-	
-	thread = new DelayAudioThread(this);
-	thread->start();
-	return 0;
-}
-
-int DelayAudio::set_string()
-{
-	if(thread) thread->window->set_title(gui_string);
-	return 0;
-}
-
-void DelayAudio::raise_window()
-{
-	if(thread)
-	{
-		thread->window->raise_window();
-		thread->window->flush();
-	}
-}
+SHOW_GUI_MACRO(DelayAudio, DelayAudioThread)
+SET_STRING_MACRO(DelayAudio)
+RAISE_WINDOW_MACRO(DelayAudio)
 
 void DelayAudio::update_gui()
 {
@@ -219,56 +183,7 @@ void DelayAudio::update_gui()
 	}
 }
 
-
-
-
-
-
-
-
-
-
-
-
-DelayAudioThread::DelayAudioThread(DelayAudio *plugin)
- : Thread()
-{
-	this->plugin = plugin;
-	set_synchronous(0);
-	completion.lock();
-}
-
-
-
-
-DelayAudioThread::~DelayAudioThread()
-{
-	delete window;
-}
-
-
-void DelayAudioThread::run()
-{
-	BC_DisplayInfo info;
-	
-	window = new DelayAudioWindow(plugin,
-		info.get_abs_cursor_x() - 125, 
-		info.get_abs_cursor_y() - 115);
-	
-	window->create_objects();
-	int result = window->run_window();
-	completion.unlock();
-// Last command executed in thread
-	if(result) plugin->client_side_close();
-}
-
-
-
-
-
-
-
-
+PLUGIN_THREAD_OBJECT(DelayAudio, DelayAudioThread, DelayAudioWindow)
 
 
 DelayAudioWindow::DelayAudioWindow(DelayAudio *plugin, int x, int y)
diff --git a/plugins/delayaudio/delayaudio.h b/plugins/delayaudio/delayaudio.h
index 1eee2d4..6ba96e1 100644
--- a/plugins/delayaudio/delayaudio.h
+++ b/plugins/delayaudio/delayaudio.h
@@ -50,20 +50,7 @@ public:
 };
 
 
-
-class DelayAudioThread : public Thread
-{
-public:
-	DelayAudioThread(DelayAudio *plugin);
-	~DelayAudioThread();
-	
-	void run();
-	
-	Mutex completion;
-	DelayAudioWindow *window;
-	DelayAudio *plugin;
-};
-
+PLUGIN_THREAD_HEADER(DelayAudio, DelayAudioThread, DelayAudioWindow)
 
 
 class DelayAudioWindow : public PluginWindow
@@ -102,31 +89,16 @@ public:
 	DelayAudio(PluginServer *server);
 	~DelayAudio();
 
-	VFrame* new_picon();
-	const char* plugin_title();
 	int is_realtime();
 	int load_defaults();
 	int save_defaults();
 	void read_data(KeyFrame *keyframe);
 	void save_data(KeyFrame *keyframe);
 	int process_realtime(int64_t size, double *input_ptr, double *output_ptr);
-	int show_gui();
-	void raise_window();
-	int set_string();
-
-
-
-
-
-	void load_configuration();
 	void update_gui();
 
-
-
 	std::vector<double> buffer;
-	DelayAudioThread *thread;
-	BC_Hash *defaults;
-	DelayAudioConfig config;
+	PLUGIN_CLASS_MEMBERS(DelayAudioConfig, DelayAudioThread)
 };
 
 
diff --git a/plugins/holo/holo.C b/plugins/holo/holo.C
index 66f391c..6e4e581 100644
--- a/plugins/holo/holo.C
+++ b/plugins/holo/holo.C
@@ -84,10 +84,7 @@ HoloMain::~HoloMain()
 const char* HoloMain::plugin_title() { return N_("HolographicTV"); }
 int HoloMain::is_realtime() { return 1; }
 
-VFrame* HoloMain::new_picon()
-{
-	return new VFrame(picon_png);
-}
+NEW_PICON_MACRO(HoloMain)
 
 int HoloMain::load_defaults()
 {
@@ -99,8 +96,9 @@ int HoloMain::save_defaults()
 	return 0;
 }
 
-void HoloMain::load_configuration()
+int HoloMain::load_configuration()
 {
+	return 0;
 }
 
 
@@ -287,30 +285,9 @@ int HoloMain::process_realtime(VFrame *input_ptr, VFrame *output_ptr)
 	return 0;
 }
 
-int HoloMain::show_gui()
-{
-	load_configuration();
-	thread = new HoloThread(this);
-	thread->start();
-	return 0;
-}
-
-int HoloMain::set_string()
-{
-	if(thread) thread->window->set_title(gui_string);
-	return 0;
-}
-
-void HoloMain::raise_window()
-{
-	if(thread)
-	{
-		thread->window->raise_window();
-		thread->window->flush();
-	}
-}
-
-
+SHOW_GUI_MACRO(HoloMain, HoloThread)
+SET_STRING_MACRO(HoloMain)
+RAISE_WINDOW_MACRO(HoloMain)
 
 
 HoloServer::HoloServer(HoloMain *plugin, int total_clients, int total_packages)
diff --git a/plugins/holo/holo.h b/plugins/holo/holo.h
index 1fc43c2..7c6526f 100644
--- a/plugins/holo/holo.h
+++ b/plugins/holo/holo.h
@@ -86,29 +86,19 @@ public:
 // required for all realtime plugins
 	int process_realtime(VFrame *input_ptr, VFrame *output_ptr);
 	int is_realtime();
-	const char* plugin_title();
-	int show_gui();
-	void raise_window();
-	int set_string();
-	void load_configuration();
+
 	void save_data(KeyFrame *keyframe);
 	void read_data(KeyFrame *keyframe);
 
 	int load_defaults();
 	int save_defaults();
-	VFrame* new_picon();
 	void reconfigure();
 
 
 	void add_frames(VFrame *output, VFrame *input);
 	void set_background();
 
-// a thread for the GUI
-	HoloThread *thread;
 	HoloServer *holo_server;
-	HoloConfig config;
-
-	BC_Hash *defaults;
 	VFrame *input_ptr, *output_ptr;
 	int do_reconfigure;
 	EffectTV *effecttv;
@@ -117,6 +107,7 @@ public:
 	VFrame *bgimage, *tmp;
 	YUV *yuv;
 	int total;
+	PLUGIN_CLASS_MEMBERS(HoloConfig, HoloThread)
 };
 
 
diff --git a/plugins/synthesizer/synthesizer.C b/plugins/synthesizer/synthesizer.C
index 94b2001..c8d694c 100644
--- a/plugins/synthesizer/synthesizer.C
+++ b/plugins/synthesizer/synthesizer.C
@@ -22,6 +22,7 @@
 #include "bcdisplayinfo.h"
 #include "clip.h"
 #include "bchash.h"
+#include "bcsignals.h"
 #include "filexml.h"
 #include "picon_png.h"
 #include "synthesizer.h"
@@ -50,31 +51,18 @@ Synth::Synth(PluginServer *server)
  : PluginAClient(server)
 {
 	reset();
-	load_defaults();
+	PLUGIN_CONSTRUCTOR_MACRO
 }
 
 
 
 Synth::~Synth()
 {
-	if(thread)
-	{
-		thread->window->set_done(0);
-		thread->completion.lock();
-		delete thread;
-	}
-
-	save_defaults();
-	delete defaults;
-	
 	if(dsp_buffer) delete [] dsp_buffer;
+	PLUGIN_DESTRUCTOR_MACRO
 }
 
-VFrame* Synth::new_picon()
-{
-	return new VFrame(picon_png);
-}
-
+NEW_PICON_MACRO(Synth)
 
 const char* Synth::plugin_title() { return N_("Synthesizer"); }
 int Synth::is_realtime() { return 1; }
@@ -83,7 +71,6 @@ int Synth::is_synthesis() { return 1; }
 
 void Synth::reset()
 {
-	thread = 0;
 	need_reconfigure = 1;
 	dsp_buffer = 0;
 }
@@ -200,29 +187,9 @@ int Synth::save_defaults()
 	return 0;
 }
 
-int Synth::show_gui()
-{
-	load_configuration();
-	
-	thread = new SynthThread(this);
-	thread->start();
-	return 0;
-}
-
-int Synth::set_string()
-{
-	if(thread) thread->window->set_utf8title(gui_string);
-	return 0;
-}
-
-void Synth::raise_window()
-{
-	if(thread)
-	{
-		thread->window->raise_window();
-		thread->window->flush();
-	}
-}
+SHOW_GUI_MACRO(Synth, SynthThread)
+SET_STRING_MACRO(Synth)
+RAISE_WINDOW_MACRO(Synth)
 
 void Synth::update_gui()
 {
@@ -492,60 +459,7 @@ void Synth::reconfigure()
 	waveform_sample = 0;
 }
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-SynthThread::SynthThread(Synth *synth)
- : Thread()
-{
-	this->synth = synth;
-	set_synchronous(0);
-	completion.lock();
-}
-
-SynthThread::~SynthThread()
-{
-	delete window;
-}
-
-void SynthThread::run()
-{
-	BC_DisplayInfo info;
-	window = new SynthWindow(synth, 
-		info.get_abs_cursor_x() - 125, 
-		info.get_abs_cursor_y() - 115);
-	window->create_objects();
-	int result = window->run_window();
-	completion.unlock();
-// Last command executed in thread
-	if(result) synth->client_side_close();
-}
-
-
-
-
-
-
-
-
-
+PLUGIN_THREAD_OBJECT(Synth, SynthThread, SynthWindow)
 
 
 SynthWindow::SynthWindow(Synth *synth, int x, int y)
diff --git a/plugins/synthesizer/synthesizer.h b/plugins/synthesizer/synthesizer.h
index f34c964..8b063e7 100644
--- a/plugins/synthesizer/synthesizer.h
+++ b/plugins/synthesizer/synthesizer.h
@@ -422,19 +422,7 @@ private:
 	float get_next_prime(float number);
 };
 
-
-class SynthThread : public Thread
-{
-public:
-	SynthThread(Synth *synth);
-	~SynthThread();
-
-	void run();
-
-	Mutex completion;
-	Synth *synth;
-	SynthWindow *window;
-};
+PLUGIN_THREAD_HEADER(Synth, SynthThread, SynthWindow)
 
 class SynthOscillatorConfig
 {
@@ -491,16 +479,10 @@ public:
 
 	int is_realtime();
 	int is_synthesis();
-	int load_configuration();
 	int load_defaults();
-	VFrame* new_picon();
-	const char* plugin_title();
 	void read_data(KeyFrame *keyframe);
 	void save_data(KeyFrame *keyframe);
 	int save_defaults();
-	int show_gui();
-	void raise_window();
-	int set_string();
 	int process_realtime(int64_t size, double *input_ptr, double *output_ptr);
 
 
@@ -535,14 +517,12 @@ public:
 
 	double *dsp_buffer;
 	int need_reconfigure;
-	BC_Hash *defaults;
-	SynthThread *thread;
-	SynthConfig config;
 	DB db;
 	int64_t waveform_length;           // length of loop buffer
 	int64_t waveform_sample;           // current sample in waveform of loop
 	int64_t samples_rendered;          // samples of the dsp_buffer rendered since last buffer redo
 	float period;            // number of samples in a period for this frequency
+	PLUGIN_CLASS_MEMBERS(SynthConfig, SynthThread)
 };
 
 
diff --git a/plugins/titler/title.C b/plugins/titler/title.C
index e940232..cc780b7 100644
--- a/plugins/titler/title.C
+++ b/plugins/titler/title.C
@@ -1088,11 +1088,7 @@ const char* TitleMain::plugin_title() { return N_("Title"); }
 int TitleMain::is_realtime() { return 1; }
 int TitleMain::is_synthesis() { return 1; }
 
-VFrame* TitleMain::new_picon()
-{
-	return new VFrame(picon_png);
-}
-
+NEW_PICON_MACRO(TitleMain)
 
 int TitleMain::load_freetype_face(FT_Library &freetype_library,
 	FT_Face &freetype_face,
@@ -1758,28 +1754,9 @@ int TitleMain::process_realtime(VFrame *input_ptr, VFrame *output_ptr)
 	return 0;
 }
 
-int TitleMain::show_gui()
-{
-	load_configuration();
-	thread = new TitleThread(this);
-	thread->start();
-	return 0;
-}
-
-int TitleMain::set_string()
-{
-	if(thread) thread->window->set_utf8title(gui_string);
-	return 0;
-}
-
-void TitleMain::raise_window()
-{
-	if(thread)
-	{
-		thread->window->raise_window();
-		thread->window->flush();
-	}
-}
+SHOW_GUI_MACRO(TitleMain, TitleThread)
+SET_STRING_MACRO(TitleMain)
+RAISE_WINDOW_MACRO(TitleMain)
 
 void TitleMain::update_gui()
 {
diff --git a/plugins/titler/title.h b/plugins/titler/title.h
index eb855b8..aa15429 100644
--- a/plugins/titler/title.h
+++ b/plugins/titler/title.h
@@ -322,17 +322,11 @@ public:
 	int process_realtime(VFrame *input_ptr, VFrame *output_ptr);
 	int is_realtime();
 	int is_synthesis();
-	const char* plugin_title();
-	int show_gui();
-	void raise_window();
 	void update_gui();
-	int set_string();
-	int load_configuration();
 	void save_data(KeyFrame *keyframe);
 	void read_data(KeyFrame *keyframe);
 	int load_defaults();
 	int save_defaults();
-	VFrame* new_picon();
 	void draw_glyphs();
 	int draw_mask();
 	void overlay_mask();
@@ -347,12 +341,7 @@ public:
 
 	static char* motion_to_text(int motion);
 	static int text_to_motion(char *text);
-// a thread for the GUI
-	TitleThread *thread;
-// Current configuration
-	TitleConfig config;
-
-	BC_Hash *defaults;
+	PLUGIN_CLASS_MEMBERS(TitleConfig, TitleThread)
 	ArrayList<TitleGlyph*> glyphs;
 	Mutex glyph_lock;
 


hooks/post-receive
-- 
CinelerraCV.git (CinelerraCV)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CinelerraCV.git" (CinelerraCV).



More information about the cinelerra-commits mailing list