#include "bctimer.h"
#include "bcwindow.h"
-#include "colors.h"
+#include "bccolors.h"
#include "keys.h"
#include "mutex.h"
#include "condition.h"
this->vw = vw;
this->vh = vh;
this->frame_rate = rate;
- this->cycle_start = 0;
- this->age = 0;
- this->seq_no = 0;
- this->in_use = 1;
+
+ cycle_start = 0;
+ age = 0;
+ seq_no = 0;
+ in_use = 1;
+ hidden = 0;
+ audio_data = 0;
+ audio_size = 0;
+ playing_audio = 0;
}
VIcon::
~VIcon()
{
clear_images();
+ delete [] audio_data;
}
void VIcon::
bool VIconThread::
visible(VIcon *vicon, int x, int y)
{
+ if( vicon->hidden ) return false;
int y0 = 0;
int my = y + vicon->vh;
if( my <= y0 ) return false;
void VIconThread::set_view_popup(VIcon *vicon)
{
+ if( !vicon && this->vicon )
+ this->vicon->stop_audio();
this->vicon = vicon;
}
VFrame *frame = viewing->frame();
view_win = new_view_window(frame);
view_win->show_window();
+ vicon->start_audio();
}
wdw->set_active_subwindow(view_win);
return 1;
now = timer->get_difference();
if( now >= draw_flash ) break;
draw(next);
- if( !next->seq_no ) next->cycle_start = now;
+ if( !next->seq_no ) {
+ next->cycle_start = now;
+ if( next->playing_audio )
+ next->start_audio();
+ }
int64_t ref_no = (now - next->cycle_start) / 1000. * refresh_rate;
int count = ref_no - next->seq_no;
if( count < 1 ) count = 1;
}
}
+
+void VIcon::init_audio(int audio_size)
+{
+ this->audio_size = audio_size;
+ audio_data = new uint8_t[audio_size];
+ memset(audio_data, 0, audio_size);
+}
+
void VIcon::dump(const char *dir)
{
mkdir(dir,0777);