r125: This commit was manufactured by cvs2svn to create tag 'r1_1_7-last'.
[cinelerra_cv/mob.git] / hvirtual / plugins / reversevideo / reversevideo.C
blob3268017996e8aa7ad8e9b00c34b34b3524b17a29
1 #include "mainprogress.h"
2 #include "reversevideo.h"
4 #include <libintl.h>
5 #define _(String) gettext(String)
6 #define gettext_noop(String) String
7 #define N_(String) gettext_noop (String)
14 PluginClient* new_plugin(PluginServer *server)
16         return new ReverseVideo(server);
28 ReverseVideo::ReverseVideo(PluginServer *server)
29  : PluginVClient(server)
31         current_position = -1;
35 ReverseVideo::~ReverseVideo()
39 char* ReverseVideo::plugin_title()
41         return _("Reverse video");
44 VFrame* ReverseVideo::new_picon()
46         return 0;
49 int ReverseVideo::start_loop()
51         if(PluginClient::interactive)
52         {
53                 char string[BCTEXTLEN];
54                 sprintf(string, "%s...", plugin_title());
55                 progress = start_progress(string, 
56                         (PluginClient::end - PluginClient::start));
57         }
59         current_position = PluginClient::end - 1;
60         return 0;
64 int ReverseVideo::stop_loop()
66         if(PluginClient::interactive)
67         {
68                 progress->stop_progress();
69                 delete progress;
70         }
71         return 0;
74 int ReverseVideo::process_loop(VFrame *buffer)
76 //printf("ReverseVideo::process_loop 1\n");
77         int result = 0;
78 //printf("ReverseVideo::process_loop 1\n");
79         
80         read_frame(buffer, current_position);
81 //printf("ReverseVideo::process_loop 2\n");
82         
83         current_position--;
84         
85         
86         if(PluginClient::interactive) 
87                 result = progress->update(PluginClient::end - current_position);
88         
89         if(current_position < PluginClient::start) result = 1;
90         
91         return result;