*
*/
+#include "arender.h"
#include "asset.h"
#include "assetedit.h"
#include "assetpopup.h"
#include "assets.h"
+#include "audiodevice.h"
#include "awindowgui.h"
#include "awindow.h"
+#include "bccmodels.h"
#include "bcsignals.h"
#include "bchash.h"
#include "cache.h"
-#include "bccmodels.h"
+#include "cstrdup.h"
+#include "clip.h"
+#include "clipedls.h"
#include "clippopup.h"
#include "cursors.h"
#include "cwindowgui.h"
#include "mainsession.h"
#include "mwindowgui.h"
#include "mwindow.h"
-#include "nestededls.h"
#include "newfolder.h"
#include "preferences.h"
+#include "proxy.h"
+#include "proxypopup.h"
+#include "renderengine.h"
+#include "samples.h"
#include "theme.h"
+#include "tracks.h"
+#include "transportque.h"
#include "vframe.h"
#include "vicon.h"
+#include "vrender.h"
#include "vwindowgui.h"
#include "vwindow.h"
N_("Labels"),
N_("Clips"),
N_("Media"),
- N_("User")
+ N_("Proxy"),
};
VFrame *AssetVIcon::frame()
{
+ Asset *asset = (Asset *)picon->indexable;
+ if( !asset->video_data && audio_data && audio_size && length > 0 ) {
+ if( !temp ) temp = new VFrame(0, -1, vw, vh, BC_RGB888, -1);
+ temp->clear_frame();
+ int sample_rate = asset->get_sample_rate();
+ int64_t audio_samples = asset->get_audio_samples();
+ double duration = (double)audio_samples / sample_rate;
+ picon->draw_hue_bar(temp, duration);
+ int secs = length / frame_rate + 0.5;
+ if( !secs ) secs = 1;
+ int bfrsz = VICON_SAMPLE_RATE;
+ int samples = audio_size/sizeof(vicon_audio_t);
+ double line_pos = (double)seq_no/(length-1);
+ int audio_pos = samples * line_pos * (secs-1)/secs;
+ vicon_audio_t *audio_data = ((vicon_audio_t *)this->audio_data) + audio_pos;
+ static const int mx = (1<<(8*sizeof(*audio_data)-1)) - 1;
+ double data[bfrsz], sample_scale = 1./mx;
+ int len = samples - audio_pos;
+ if( len > bfrsz ) len = bfrsz;
+ int i = 0;
+ while( i < len ) data[i++] = *audio_data++ * sample_scale;
+ while( i < bfrsz ) data[i++] = 0;
+ picon->draw_wave(temp, data, bfrsz, RED, GREEN);
+ int x = (vw-1) * line_pos;
+ temp->pixel_rgb = RED;
+ temp->draw_line(x,0, x,vh);
+ return temp;
+ }
if( seq_no >= images.size() ) {
MWindow *mwindow = picon->mwindow;
- Asset *asset = (Asset *)picon->indexable;
File *file = mwindow->video_cache->check_out(asset, mwindow->edl, 1);
if( !file ) return 0;
if( temp && (temp->get_w() != asset->width || temp->get_h() != asset->height) ) {
delete temp; temp = 0;
}
if( !temp )
- temp = new VFrame(asset->width, asset->height, BC_RGB888);
+ temp = new VFrame(0, -1, asset->width, asset->height, BC_RGB888, -1);
int ww = picon->gui->vicon_thread->view_w;
int hh = picon->gui->vicon_thread->view_h;
while( seq_no >= images.size() ) {
file->set_layer(0);
int64_t pos = images.size() / picon->gui->vicon_thread->refresh_rate * frame_rate;
file->set_video_position(pos,0);
- file->read_frame(temp);
+ if( file->read_frame(temp) ) temp->clear_frame();
add_image(temp, ww, hh, BC_RGB8);
}
mwindow->video_cache->check_in(asset);
return lbox->get_item_y(picon) + lbox->get_title_h();
}
+void AssetVIcon::load_audio()
+{
+ MWindow *mwindow = picon->mwindow;
+ Asset *asset = (Asset *)picon->indexable;
+ File *file = mwindow->audio_cache->check_out(asset, mwindow->edl, 1);
+ int channels = asset->get_audio_channels();
+ if( channels > 2 ) channels = 2;
+ int sample_rate = asset->get_sample_rate();
+ int bfrsz = sample_rate;
+ Samples samples(bfrsz);
+ double time_scale = (double)sample_rate / VICON_SAMPLE_RATE;
+ vicon_audio_t *audio_data = (vicon_audio_t *)this->audio_data;
+ static const int mx = (1<<(8*sizeof(*audio_data)-1)) - 1;
+ double sample_scale = (double)mx / channels;
+ int audio_pos = 0, audio_len = audio_size/sizeof(vicon_audio_t);
+ while( audio_pos < audio_len ) {
+ int64_t pos = audio_pos * time_scale;
+ for( int ch=0; ch<channels; ++ch ) {
+ file->set_channel(ch);
+ file->set_audio_position(pos);
+ file->read_samples(&samples, bfrsz);
+ double *data = samples.get_data();
+ for( int64_t k=audio_pos; k<audio_len; ++k ) {
+ int i = k * time_scale - pos;
+ if( i >= bfrsz ) break;
+ int v = audio_data[k] + data[i] * sample_scale;
+ audio_data[k] = CLIP(v, -mx,mx);
+ }
+ }
+ audio_pos = (pos + bfrsz) / time_scale;
+ }
+ mwindow->audio_cache->check_in(asset);
+}
+
+
+AssetVIconAudio::AssetVIconAudio(AWindowGUI *gui)
+ : Thread(1, 0, 0)
+{
+ this->gui = gui;
+ audio = new AudioDevice(gui->mwindow);
+ interrupted = 0;
+ vicon = 0;
+}
+AssetVIconAudio::~AssetVIconAudio()
+{
+ delete audio;
+}
+
+void AssetVIconAudio::run()
+{
+ int channels = 2;
+ int64_t bfrsz = VICON_SAMPLE_RATE;
+ MWindow *mwindow = gui->mwindow;
+ EDL *edl = mwindow->edl;
+ EDLSession *session = edl->session;
+ AudioOutConfig *aconfig = session->playback_config->aconfig;
+ audio->open_output(aconfig, VICON_SAMPLE_RATE, bfrsz, channels, 0);
+ audio->start_playback();
+ double out0[bfrsz], out1[bfrsz], *out[2] = { out0, out1 };
+ vicon_audio_t *audio_data = (vicon_audio_t *)vicon->audio_data;
+ static const int mx = (1<<(8*sizeof(*audio_data)-1)) - 1;
+
+ int audio_len = vicon->audio_size/sizeof(vicon_audio_t);
+ while( !interrupted ) {
+ int len = audio_len - audio_pos;
+ if( len <= 0 ) break;
+ if( len > bfrsz ) len = bfrsz;
+ int k = audio_pos;
+ for( int i=0; i<len; ++i,++k )
+ out0[i] = out1[i] = (double)audio_data[k] / mx;
+ audio_pos = k;
+ audio->write_buffer(out, channels, len);
+ }
+
+ if( !interrupted )
+ audio->set_last_buffer();
+ audio->stop_audio(interrupted ? 0 : 1);
+ audio->close_all();
+}
+
+void AssetVIconAudio::start(AssetVIcon *vicon)
+{
+ if( running() ) return;
+ interrupted = 0;
+ audio_pos = 0;
+ this->vicon = vicon;
+ Thread::start();
+}
+
+void AssetVIconAudio::stop(int wait)
+{
+ if( running() && !interrupted ) {
+ interrupted = 1;
+ audio->stop_audio(wait);
+ }
+ Thread::join();
+ if( vicon ) {
+ vicon->playing_audio = 0;
+ vicon = 0;
+ }
+}
+
+void AssetVIcon::start_audio()
+{
+ picon->gui->vicon_audio->stop(0);
+ playing_audio = 1;
+ picon->gui->vicon_audio->start(this);
+}
+
+void AssetVIcon::stop_audio()
+{
+ picon->gui->vicon_audio->stop(0);
+ playing_audio = 0;
+}
+
AssetPicon::AssetPicon(MWindow *mwindow,
- AWindowGUI *gui,
- Indexable *indexable)
+ AWindowGUI *gui, Indexable *indexable)
: BC_ListBoxItem()
{
reset();
}
AssetPicon::AssetPicon(MWindow *mwindow,
- AWindowGUI *gui,
- EDL *edl)
+ AWindowGUI *gui, EDL *edl)
: BC_ListBoxItem()
{
reset();
AssetPicon::AssetPicon(MWindow *mwindow,
AWindowGUI *gui, int folder, int persist)
- : BC_ListBoxItem(_(AWindowGUI::folder_names[folder]), gui->folder_icon)
+ : BC_ListBoxItem(_(AWindowGUI::folder_names[folder]),
+ folder>=0 && folder<AWINDOW_FOLDERS ?
+ gui->folder_icons[folder]: gui->folder_icon)
{
reset();
foldernum = folder;
}
AssetPicon::AssetPicon(MWindow *mwindow,
- AWindowGUI *gui, const char *folder_name, int folder_num)
- : BC_ListBoxItem(folder_name, gui->folder_icon)
-{
- reset();
- foldernum = folder_num;
- this->mwindow = mwindow;
- this->gui = gui;
-}
-
-AssetPicon::AssetPicon(MWindow *mwindow,
- AWindowGUI *gui,
- PluginServer *plugin)
+ AWindowGUI *gui, PluginServer *plugin)
: BC_ListBoxItem()
{
reset();
this->plugin = plugin;
}
-
AssetPicon::AssetPicon(MWindow *mwindow,
- AWindowGUI *gui,
- Label *label)
+ AWindowGUI *gui, Label *label)
: BC_ListBoxItem()
{
reset();
}
}
+void AssetPicon::draw_hue_bar(VFrame *frame, double duration)
+{
+ float t = duration > 1 ? (log(duration) / log(3600.f)) : 0;
+ if( t > 1 ) t = 1;
+ float h = 300 * t, s = 1., v = 1.;
+ float r, g, b; // duration, 0..1hr == hue red..magenta
+ HSV::hsv_to_rgb(r,g,b, h,s,v);
+ int ih = frame->get_h()/8, iw = frame->get_w();
+ int ir = r * 256; CLAMP(ir, 0,255);
+ int ig = g * 256; CLAMP(ig, 0,255);
+ int ib = b * 256; CLAMP(ib, 0,255);
+ unsigned char **rows = frame->get_rows();
+ for( int y=0; y<ih; ++y ) {
+ unsigned char *rp = rows[y];
+ for( int x=0; x<iw; rp+=3,++x ) {
+ rp[0] = ir; rp[1] = ig; rp[2] = ib;
+ }
+ }
+}
+
+void AssetPicon::draw_wave(VFrame *frame, double *dp, int len, int base_color, int line_color)
+{
+ int w = frame->get_w(), h = frame->get_h();
+ int h1 = h-1, h2 = h/2, y = h2;
+ int rgb_color = frame->pixel_rgb;
+ for( int x=0,x1=0,x2=0; x<w; ++x,x1=x2 ) {
+ double min = *dp, max = min;
+ x2 = (len * (x+1))/w;
+ for( int i=x1; i<x2; ++i ) {
+ double value = *dp++;
+ if( value < min ) min = value;
+ if( value > max ) max = value;
+ }
+ int ctr = (min + max) / 2;
+ int y0 = (int)(h2 - ctr*h2); CLAMP(y0, 0,h1);
+ int y1 = (int)(h2 - min*h2); CLAMP(y1, 0,h1);
+ int y2 = (int)(h2 - max*h2); CLAMP(y2, 0,h1);
+ frame->pixel_rgb = line_color;
+ frame->draw_line(x,y1, x,y2);
+ frame->pixel_rgb = base_color;
+ frame->draw_line(x,y, x,y0);
+ y = y0;
+ }
+ frame->pixel_rgb = rgb_color;
+}
+
void AssetPicon::reset()
{
plugin = 0;
label = 0;
indexable = 0;
edl = 0;
+ foldernum = AW_NO_FOLDER;
icon = 0;
icon_vframe = 0;
vicon = 0;
in_use = 1;
+ mtime = 0;
id = 0;
persistent = 0;
}
+void AssetPicon::open_render_engine(EDL *edl, int is_audio)
+{
+ TransportCommand command;
+ command.command = is_audio ? NORMAL_FWD : CURRENT_FRAME;
+ command.get_edl()->copy_all(edl);
+ command.change_type = CHANGE_ALL;
+ command.realtime = 0;
+ render_engine = new RenderEngine(0, mwindow->preferences, 0, 0);
+ render_engine->set_vcache(mwindow->video_cache);
+ render_engine->set_acache(mwindow->audio_cache);
+ render_engine->arm_command(&command);
+}
+void AssetPicon::close_render_engine()
+{
+ delete render_engine; render_engine = 0;
+}
+void AssetPicon::render_video(int64_t pos, VFrame *vfrm)
+{
+ if( !render_engine || !render_engine->vrender ) return;
+ render_engine->vrender->process_buffer(vfrm, pos, 0);
+}
+void AssetPicon::render_audio(int64_t pos, Samples **samples, int len)
+{
+ if( !render_engine || !render_engine->arender ) return;
+ render_engine->arender->process_buffer(samples, len, pos);
+}
+
void AssetPicon::create_objects()
{
FileSystem fs;
char name[BCTEXTLEN];
int pixmap_w, pixmap_h;
- const int debug = 0;
pixmap_h = 50 * BC_WindowBase::get_resources()->icon_scale;
- if( debug ) printf("AssetPicon::create_objects %d\n", __LINE__);
if( indexable ) {
fs.extract_name(name, indexable->path);
set_text(name);
}
+ else if( edl ) {
+ set_text(strcpy(name, edl->local_session->clip_title));
+ set_text(name);
+ }
if( indexable && indexable->is_asset ) {
- if( debug ) printf("AssetPicon::create_objects %d\n", __LINE__);
Asset *asset = (Asset*)indexable;
if( asset->video_data ) {
if( mwindow->preferences->use_thumbnails ) {
gui->unlock_window();
- if( debug ) printf("AssetPicon::create_objects %d\n", __LINE__);
File *file = mwindow->video_cache->check_out(asset,
mwindow->edl,
1);
- if( debug ) printf("AssetPicon::create_objects %d\n", __LINE__);
if( file ) {
int height = asset->height > 0 ? asset->height : 1;
mwindow->gui->show_message(string);
mwindow->gui->unlock_window(); }
file->read_frame(gui->temp_picon);
- if( debug ) printf("AssetPicon::create_objects %d\n", __LINE__);
mwindow->video_cache->check_in(asset);
- gui->lock_window("AssetPicon::create_objects 1");
+ gui->lock_window("AssetPicon::create_objects 0");
icon = new BC_Pixmap(gui, pixmap_w, pixmap_h);
icon->draw_vframe(gui->temp_picon,
0, 0, pixmap_w, pixmap_h, 0, 0);
-//printf("%d %d\n", gui->temp_picon->get_w(), gui->temp_picon->get_h());
icon_vframe = new VFrame(0,
-1, pixmap_w, pixmap_h, BC_RGB888, -1);
icon_vframe->transfer_from(gui->temp_picon);
+ if( asset->awindow_folder == AW_MEDIA_FOLDER ) {
// vicon images
- double framerate = asset->get_frame_rate();
- if( !framerate ) framerate = VICON_RATE;
- int64_t frames = asset->get_video_frames();
- double secs = frames / framerate;
- if( secs > 5 ) secs = 5;
- int64_t length = secs * gui->vicon_thread->refresh_rate;
- vicon = new AssetVIcon(this, pixmap_w, pixmap_h, framerate, length);
- gui->vicon_thread->add_vicon(vicon);
- if( debug ) printf("AssetPicon::create_objects %d\n", __LINE__);
+ double framerate = asset->get_frame_rate();
+ if( !framerate ) framerate = VICON_RATE;
+ int64_t frames = asset->get_video_frames();
+ double secs = frames / framerate;
+ if( secs > 5 ) secs = 5;
+ int64_t length = secs * gui->vicon_thread->refresh_rate;
+ vicon = new AssetVIcon(this, pixmap_w, pixmap_h, framerate, length);
+ if( asset->audio_data && secs > 0 ) {
+ gui->unlock_window();
+ int audio_len = VICON_SAMPLE_RATE*secs+0.5;
+ vicon->init_audio(audio_len*sizeof(vicon_audio_t));
+ vicon->load_audio();
+ gui->lock_window("AssetPicon::create_objects 1");
+ }
+ gui->vicon_thread->add_vicon(vicon);
+ }
}
else {
gui->lock_window("AssetPicon::create_objects 2");
icon = gui->video_icon;
- icon_vframe = BC_WindowBase::get_resources()->type_to_icon[ICON_FILM];
+ icon_vframe = gui->video_vframe;
}
}
else {
icon = gui->video_icon;
- icon_vframe = BC_WindowBase::get_resources()->type_to_icon[ICON_FILM];
+ icon_vframe = gui->video_vframe;
}
}
else
if( asset->audio_data ) {
- icon = gui->audio_icon;
- icon_vframe = BC_WindowBase::get_resources()->type_to_icon[ICON_SOUND];
- }
-//printf("AssetPicon::create_objects 2\n");
+ if( mwindow->preferences->use_thumbnails ) {
+ gui->unlock_window();
+ File *file = mwindow->audio_cache->check_out(asset,
+ mwindow->edl,
+ 1);
+ if( file ) {
+ pixmap_w = pixmap_h * 16/9;
+ icon_vframe = new VFrame(0,
+ -1, pixmap_w, pixmap_h, BC_RGB888, -1);
+ icon_vframe->clear_frame();
+ { char string[BCTEXTLEN];
+ sprintf(string, _("Reading %s"), name);
+ mwindow->gui->lock_window("AssetPicon::create_objects 3");
+ mwindow->gui->show_message(string);
+ mwindow->gui->unlock_window(); }
+ int sample_rate = asset->get_sample_rate();
+ int channels = asset->get_audio_channels();
+ if( channels > 2 ) channels = 2;
+ int64_t audio_samples = asset->get_audio_samples();
+ double duration = (double)audio_samples / sample_rate;
+ draw_hue_bar(icon_vframe, duration);
+ int bfrsz = sample_rate;
+ Samples samples(bfrsz);
+ static int line_colors[2] = { GREEN, YELLOW };
+ static int base_colors[2] = { RED, PINK };
+ for( int i=channels; --i>=0; ) {
+ file->set_channel(i);
+ file->set_audio_position(0);
+ file->read_samples(&samples, bfrsz);
+ draw_wave(icon_vframe, samples.get_data(), bfrsz,
+ base_colors[i], line_colors[i]);
+ }
+ mwindow->audio_cache->check_in(asset);
+ if( asset->awindow_folder == AW_MEDIA_FOLDER ) {
+ double secs = duration;
+ if( secs > 5 ) secs = 5;
+ double refresh_rate = gui->vicon_thread->refresh_rate;
+ int64_t length = secs * refresh_rate;
+ vicon = new AssetVIcon(this, pixmap_w, pixmap_h, refresh_rate, length);
+ int audio_len = VICON_SAMPLE_RATE*secs+0.5;
+ vicon->init_audio(audio_len*sizeof(vicon_audio_t));
+ vicon->load_audio();
+ gui->vicon_thread->add_vicon(vicon);
+ }
+ gui->lock_window("AssetPicon::create_objects 4");
+ icon = new BC_Pixmap(gui, pixmap_w, pixmap_h);
+ icon->draw_vframe(icon_vframe,
+ 0, 0, pixmap_w, pixmap_h, 0, 0);
+ }
+ else {
+ gui->lock_window("AssetPicon::create_objects 5");
+ icon = gui->audio_icon;
+ icon_vframe = gui->audio_vframe;
+ }
+ }
+ else {
+ icon = gui->audio_icon;
+ icon_vframe = gui->audio_vframe;
+ }
- if( debug ) printf("AssetPicon::create_objects %d\n", __LINE__);
+ }
+ struct stat st;
+ mtime = !stat(asset->path, &st) ? st.st_mtime : 0;
}
else
if( indexable && !indexable->is_asset ) {
icon = gui->video_icon;
- icon_vframe = BC_WindowBase::get_resources()->type_to_icon[ICON_FILM];
+ icon_vframe = gui->video_vframe;
}
else
if( edl ) {
-//printf("AssetPicon::create_objects 4 %s\n", edl->local_session->clip_title);
- set_text(strcpy(name, edl->local_session->clip_title));
- icon = gui->clip_icon;
- icon_vframe = mwindow->theme->get_image("clip_icon");
+ if( edl->tracks->playable_video_tracks() ) {
+ if( mwindow->preferences->use_thumbnails ) {
+ gui->unlock_window();
+ char clip_icon_path[BCTEXTLEN];
+ char *clip_icon = edl->local_session->clip_icon;
+ if( clip_icon[0] ) {
+ snprintf(clip_icon_path, sizeof(clip_icon_path),
+ "%s/%s", File::get_config_path(), clip_icon);
+ icon_vframe = VFramePng::vframe_png(clip_icon_path);
+ }
+ if( !icon_vframe ) {
+//printf("render clip: %s\n", name);
+ int edl_h = edl->get_h(), edl_w = edl->get_w();
+ int height = edl_h > 0 ? edl_h : 1;
+ int width = edl_w > 0 ? edl_w : 1;
+ int color_model = edl->session->color_model;
+ pixmap_w = pixmap_h * width / height;
+
+ if( gui->temp_picon &&
+ (gui->temp_picon->get_color_model() != color_model ||
+ gui->temp_picon->get_w() != width ||
+ gui->temp_picon->get_h() != height) ) {
+ delete gui->temp_picon; gui->temp_picon = 0;
+ }
+
+ if( !gui->temp_picon ) {
+ gui->temp_picon = new VFrame(0, -1,
+ width, height, color_model, -1);
+ }
+ char string[BCTEXTLEN];
+ sprintf(string, _("Rendering %s"), name);
+ mwindow->gui->lock_window("AssetPicon::create_objects");
+ mwindow->gui->show_message(string);
+ mwindow->gui->unlock_window();
+ open_render_engine(edl, 0);
+ render_video(0, gui->temp_picon);
+ close_render_engine();
+ gui->lock_window("AssetPicon::create_objects 0");
+ icon_vframe = new VFrame(0,
+ -1, pixmap_w, pixmap_h, BC_RGB888, -1);
+ icon_vframe->transfer_from(gui->temp_picon);
+ if( clip_icon[0] ) icon_vframe->write_png(clip_icon_path);
+ }
+ else {
+ pixmap_w = icon_vframe->get_w();
+ pixmap_h = icon_vframe->get_h();
+ }
+ icon = new BC_Pixmap(gui, pixmap_w, pixmap_h);
+ icon->draw_vframe(icon_vframe,
+ 0, 0, pixmap_w, pixmap_h, 0, 0);
+ }
+ else {
+ icon = gui->clip_icon;
+ icon_vframe = gui->clip_vframe;
+ }
+ }
+ else
+ if( edl->tracks->playable_audio_tracks() ) {
+ if( mwindow->preferences->use_thumbnails ) {
+ gui->unlock_window();
+ char clip_icon_path[BCTEXTLEN];
+ char *clip_icon = edl->local_session->clip_icon;
+ if( clip_icon[0] ) {
+ snprintf(clip_icon_path, sizeof(clip_icon_path),
+ "%s/%s", File::get_config_path(), clip_icon);
+ icon_vframe = VFramePng::vframe_png(clip_icon_path);
+ }
+ if( !icon_vframe ) {
+ pixmap_w = pixmap_h * 16/9;
+ icon_vframe = new VFrame(0,
+ -1, pixmap_w, pixmap_h, BC_RGB888, -1);
+ icon_vframe->clear_frame();
+ char string[BCTEXTLEN];
+ sprintf(string, _("Rendering %s"), name);
+ mwindow->gui->lock_window("AssetPicon::create_objects 3");
+ mwindow->gui->show_message(string);
+ mwindow->gui->unlock_window();
+ int sample_rate = edl->get_sample_rate();
+ int channels = edl->get_audio_channels();
+ if( channels > 2 ) channels = 2;
+ int64_t audio_samples = edl->get_audio_samples();
+ double duration = (double)audio_samples / sample_rate;
+ draw_hue_bar(icon_vframe, duration);
+ Samples *samples[MAX_CHANNELS];
+ int bfrsz = sample_rate;
+ for( int i=0; i<MAX_CHANNELS; ++i )
+ samples[i] = i<channels ? new Samples(bfrsz) : 0;
+ open_render_engine(edl, 1);
+ render_audio(0, samples, bfrsz);
+ close_render_engine();
+ gui->lock_window("AssetPicon::create_objects 4");
+ static int line_colors[2] = { GREEN, YELLOW };
+ static int base_colors[2] = { RED, PINK };
+ for( int i=channels; --i>=0; ) {
+ draw_wave(icon_vframe, samples[i]->get_data(), bfrsz,
+ base_colors[i], line_colors[i]);
+ }
+ for( int i=0; i<channels; ++i ) delete samples[i];
+ if( clip_icon[0] ) icon_vframe->write_png(clip_icon_path);
+ }
+ else {
+ pixmap_w = icon_vframe->get_w();
+ pixmap_h = icon_vframe->get_h();
+ }
+ icon = new BC_Pixmap(gui, pixmap_w, pixmap_h);
+ icon->draw_vframe(icon_vframe,
+ 0, 0, pixmap_w, pixmap_h, 0, 0);
+ }
+ else {
+ icon = gui->clip_icon;
+ icon_vframe = gui->clip_vframe;
+ }
+ }
}
else
if( plugin ) {
- strcpy(name, plugin->title);
+ strcpy(name, _(plugin->title));
set_text(name);
icon_vframe = plugin->get_picon();
if( icon_vframe )
mwindow->edl->session->frames_per_foot);
set_text(name);
icon = gui->label_icon;
- icon_vframe = BC_WindowBase::get_resources()->type_to_icon[ICON_LABEL];
- set_icon(icon);
- set_icon_vframe(icon_vframe);
+ icon_vframe = gui->label_vframe;
}
if( !icon ) {
icon = gui->file_icon;
}
set_icon(icon);
set_icon_vframe(icon_vframe);
-
- if( debug ) printf("AssetPicon::create_objects %d\n", __LINE__);
}
-
-
-
-
-
AWindowGUI::AWindowGUI(MWindow *mwindow, AWindow *awindow)
: BC_Window(_(PROGRAM_NAME ": Resources"),
mwindow->session->awindow_x, mwindow->session->awindow_y,
mwindow->session->awindow_w, mwindow->session->awindow_h,
100, 100, 1, 1, 1)
{
-// printf("AWindowGUI::AWindowGUI %d %d %d %d\n",
-// mwindow->session->awindow_x,
-// mwindow->session->awindow_y,
-// mwindow->session->awindow_w,
-// mwindow->session->awindow_h);
this->mwindow = mwindow;
this->awindow = awindow;
- file_icon = 0;
- audio_icon = 0;
- video_icon = 0;
- folder_icon = 0;
- clip_icon = 0;
- label_icon = 0;
- atransition_icon = 0; atransition_vframe = 0;
- vtransition_icon = 0; vtransition_vframe = 0;
- aeffect_icon = 0; aeffect_vframe = 0;
- ladspa_icon = 0; ladspa_vframe = 0;
- veffect_icon = 0; veffect_vframe = 0;
- ff_aud_icon = 0; ff_aud_vframe = 0;
- ff_vid_icon = 0; ff_vid_vframe = 0;
+
+ file_vframe = 0; file_icon = 0;
+ folder_vframe = 0; folder_icon = 0;
+ audio_vframe = 0; audio_icon = 0;
+ video_vframe = 0; video_icon = 0;
+ label_vframe = 0; label_icon = 0;
+
+ atransition_vframe = 0; atransition_icon = 0;
+ vtransition_vframe = 0; vtransition_icon = 0;
+ aeffect_vframe = 0; aeffect_icon = 0;
+ ladspa_vframe = 0; ladspa_icon = 0;
+ veffect_vframe = 0; veffect_icon = 0;
+ ff_aud_vframe = 0; ff_aud_icon = 0;
+ ff_vid_vframe = 0; ff_vid_icon = 0;
+
+ aeffect_folder_vframe = 0; aeffect_folder_icon = 0;
+ atransition_folder_vframe = 0; atransition_folder_icon = 0;
+ clip_folder_vframe = 0; clip_folder_icon = 0;
+ label_folder_vframe = 0; label_folder_icon = 0;
+ media_folder_vframe = 0; media_folder_icon = 0;
+ proxy_folder_vframe = 0; proxy_folder_icon = 0;
+ veffect_folder_vframe = 0; veffect_folder_icon = 0;
+ vtransition_folder_vframe = 0; vtransition_folder_icon = 0;
+
+ ladspa_vframe = 0; ladspa_icon = 0;
+ ff_aud_vframe = 0; ff_aud_icon = 0;
+ ff_vid_vframe = 0; ff_vid_icon = 0;
+
+ clip_vframe = 0; clip_icon = 0;
+ atransition_vframe = 0; atransition_icon = 0;
+ vtransition_vframe = 0; vtransition_icon = 0;
+ aeffect_vframe = 0; aeffect_icon = 0;
+ veffect_vframe = 0; veffect_icon = 0;
+
plugin_visibility = ((uint64_t)1<<(8*sizeof(uint64_t)-1))-1;
newfolder_thread = 0;
asset_menu = 0;
effectlist_menu = 0;
assetlist_menu = 0;
cliplist_menu = 0;
+ proxylist_menu = 0;
labellist_menu = 0;
folderlist_menu = 0;
temp_picon = 0;
+ search_text = 0;
allow_iconlisting = 1;
remove_plugin = 0;
vicon_thread = 0;
+ vicon_audio = 0;
vicon_drawing = 1;
displayed_folder = AW_NO_FOLDER;
+ folder_lock = new Mutex("AWindowGUI::folder_lock");
}
AWindowGUI::~AWindowGUI()
displayed_assets[1].remove_all_objects();
delete vicon_thread;
- delete file_icon; delete file_res;
- delete audio_icon; delete audio_res;
- delete video_icon; delete video_res;
- delete folder_icon; delete folder_res;
- delete clip_icon; delete clip_res;
- delete label_icon; delete label_res;
- delete atransition_icon; delete atrans_res;
- delete vtransition_icon; delete vtrans_res;
- delete aeffect_icon; delete aeffect_res;
- delete veffect_icon; delete veffect_res;
- delete ladspa_icon; delete ladspa_res;
- delete ff_aud_icon; delete ff_aud_res;
- delete ff_vid_icon; delete ff_vid_res;
+ delete vicon_audio;
delete newfolder_thread;
- delete asset_menu;
- delete clip_menu;
- delete label_menu;
- delete effectlist_menu;
- delete assetlist_menu;
- delete cliplist_menu;
- delete labellist_menu;
- delete folderlist_menu;
+
+ delete search_text;
delete temp_picon;
delete remove_plugin;
+
+ delete file_vframe; delete file_icon;
+ delete folder_vframe; delete folder_icon;
+ delete audio_vframe; delete audio_icon;
+ delete video_vframe; delete video_icon;
+ delete label_vframe; delete label_icon;
+ delete clip_vframe; delete clip_icon;
+ delete aeffect_folder_vframe; delete aeffect_folder_icon;
+ delete atransition_folder_vframe; delete atransition_folder_icon;
+ delete veffect_folder_vframe; delete veffect_folder_icon;
+ delete vtransition_folder_vframe; delete vtransition_folder_icon;
+ delete clip_folder_vframe; delete clip_folder_icon;
+ delete label_folder_vframe; delete label_folder_icon;
+ delete media_folder_vframe; delete media_folder_icon;
+ delete proxy_folder_vframe; delete proxy_folder_icon;
+ delete ladspa_vframe; delete ladspa_icon;
+ delete ff_aud_vframe; delete ff_aud_icon;
+ delete ff_vid_vframe; delete ff_vid_icon;
+ delete atransition_vframe; delete atransition_icon;
+ delete vtransition_vframe; delete vtransition_icon;
+ delete aeffect_vframe; delete aeffect_icon;
+ delete veffect_vframe; delete veffect_icon;
+ delete folder_lock;
}
bool AWindowGUI::protected_pixmap(BC_Pixmap *icon)
icon == aeffect_icon ||
icon == ladspa_icon ||
icon == ff_aud_icon ||
- icon == ff_vid_icon;
+ icon == ff_vid_icon ||
+ icon == aeffect_folder_icon ||
+ icon == veffect_folder_icon ||
+ icon == atransition_folder_icon ||
+ icon == vtransition_folder_icon ||
+ icon == label_folder_icon ||
+ icon == clip_folder_icon ||
+ icon == media_folder_icon ||
+ icon == proxy_folder_icon;
}
VFrame *AWindowGUI::get_picon(const char *name, const char *plugin_icons)
{
char png_path[BCTEXTLEN];
char *pp = png_path, *ep = pp + sizeof(png_path)-1;
- pp += snprintf(pp, ep-pp, "%s/picon", File::get_plugin_path());
- if( strcmp(DEFAULT_PICON, plugin_icons) )
- pp += snprintf(pp, ep-pp, "_%s", plugin_icons);
- pp += snprintf(pp, ep-pp, "/%s.png", name);
+ snprintf(pp, ep-pp, "%s/picon/%s/%s.png",
+ File::get_plugin_path(), plugin_icons, name);
+ if( access(png_path, R_OK) ) return 0;
return VFramePng::vframe_png(png_path,0,0);
}
VFrame *AWindowGUI::get_picon(const char *name)
{
VFrame *vframe = get_picon(name, mwindow->preferences->plugin_icons);
- if( !vframe ) vframe = get_picon(name, DEFAULT_PICON);
+ if( !vframe ) {
+ char png_name[BCSTRLEN], *pp = png_name, *ep = pp + sizeof(png_name)-1;
+ snprintf(pp, ep-pp, "%s.png", name);
+ unsigned char *data = mwindow->theme->get_image_data(png_name);
+ if( data ) vframe = new VFramePng(data, 0.);
+ }
return vframe;
}
-VFrame *AWindowGUI::resource_icon(VFrame *&vfrm, BC_Pixmap *&icon, const char *fn, int idx)
+void AWindowGUI::resource_icon(VFrame *&vfrm, BC_Pixmap *&icon, const char *fn, int idx)
{
- VFrame *ret = vfrm = get_picon(fn);
- if( !ret ) vfrm = BC_WindowBase::get_resources()->type_to_icon[idx];
+ vfrm = get_picon(fn);
+ if( !vfrm ) vfrm = BC_WindowBase::get_resources()->type_to_icon[idx];
icon = new BC_Pixmap(this, vfrm, PIXMAP_ALPHA);
- return ret;
}
-VFrame *AWindowGUI::theme_icon(VFrame *&vfrm, BC_Pixmap *&icon, const char *fn)
+void AWindowGUI::theme_icon(VFrame *&vfrm, BC_Pixmap *&icon, const char *fn)
{
- VFrame *ret = vfrm = get_picon(fn);
- if( !ret ) vfrm = mwindow->theme->get_image(fn);
+ vfrm = get_picon(fn);
+ if( !vfrm ) vfrm = mwindow->theme->get_image(fn);
icon = new BC_Pixmap(this, vfrm, PIXMAP_ALPHA);
- return ret;
}
-VFrame *AWindowGUI::plugin_icon(VFrame *&vfrm, BC_Pixmap *&icon, const char *fn, unsigned char *png)
+void AWindowGUI::plugin_icon(VFrame *&vfrm, BC_Pixmap *&icon, const char *fn, unsigned char *png)
{
- VFrame *ret = vfrm = get_picon(fn);
- if( !ret ) vfrm = new VFramePng(png);
+ vfrm = get_picon(fn);
+ if( !vfrm ) vfrm = new VFramePng(png);
icon = new BC_Pixmap(this, vfrm, PIXMAP_ALPHA);
- return vfrm;
}
void AWindowGUI::create_objects()
{
lock_window("AWindowGUI::create_objects");
-SET_TRACE
-//printf("AWindowGUI::create_objects 1\n");
- asset_titles[0] = _("Title");
+ asset_titles[0] = C_("Title");
asset_titles[1] = _("Comments");
-SET_TRACE
set_icon(mwindow->theme->get_image("awindow_icon"));
- file_res = resource_icon(file_vframe, file_icon, "film_icon", ICON_UNKNOWN);
- folder_res = resource_icon(folder_vframe, folder_icon, "folder_icon", ICON_FOLDER);
- audio_res = resource_icon(audio_vframe, audio_icon, "audio_icon", ICON_SOUND);
- video_res = resource_icon(video_vframe, video_icon, "video_icon", ICON_FILM);
- label_res = resource_icon(label_vframe, label_icon, "label_icon", ICON_LABEL);
-
- clip_res = theme_icon(clip_vframe, clip_icon, "clip_icon");
- atrans_res = theme_icon(atransition_vframe, atransition_icon, "atransition_icon");
- vtrans_res = theme_icon(vtransition_vframe, vtransition_icon, "vtransition_icon");
- aeffect_res = theme_icon(aeffect_vframe, aeffect_icon, "aeffect_icon");
- veffect_res = theme_icon(veffect_vframe, veffect_icon, "veffect_icon");
-
- ladspa_res = plugin_icon(ladspa_vframe, ladspa_icon, "lad_picon", lad_picon_png);
- ff_aud_res = plugin_icon(ff_aud_vframe, ff_aud_icon, "ff_audio", ff_audio_png);
- ff_vid_res = plugin_icon(ff_vid_vframe, ff_vid_icon, "ff_video", ff_video_png);
-
-SET_TRACE
-
+ resource_icon(file_vframe, file_icon, "film_icon", ICON_UNKNOWN);
+ resource_icon(folder_vframe, folder_icon, "folder_icon", ICON_FOLDER);
+ resource_icon(audio_vframe, audio_icon, "audio_icon", ICON_SOUND);
+ resource_icon(video_vframe, video_icon, "video_icon", ICON_FILM);
+ resource_icon(label_vframe, label_icon, "label_icon", ICON_LABEL);
+
+ theme_icon(aeffect_folder_vframe, aeffect_folder_icon, "aeffect_folder");
+ theme_icon(atransition_folder_vframe, atransition_folder_icon, "atransition_folder");
+ theme_icon(clip_folder_vframe, clip_folder_icon, "clip_folder");
+ theme_icon(label_folder_vframe, label_folder_icon, "label_folder");
+ theme_icon(media_folder_vframe, media_folder_icon, "media_folder");
+ theme_icon(proxy_folder_vframe, proxy_folder_icon, "proxy_folder");
+ theme_icon(veffect_folder_vframe, veffect_folder_icon, "veffect_folder");
+ theme_icon(vtransition_folder_vframe, vtransition_folder_icon, "vtransition_folder");
+
+ folder_icons[AW_AEFFECT_FOLDER] = aeffect_folder_icon;
+ folder_icons[AW_VEFFECT_FOLDER] = veffect_folder_icon;
+ folder_icons[AW_ATRANSITION_FOLDER] = atransition_folder_icon;
+ folder_icons[AW_VTRANSITION_FOLDER] = vtransition_folder_icon;
+ folder_icons[AW_LABEL_FOLDER] = label_folder_icon;
+ folder_icons[AW_CLIP_FOLDER] = clip_folder_icon;
+ folder_icons[AW_MEDIA_FOLDER] = media_folder_icon;
+ folder_icons[AW_PROXY_FOLDER] = proxy_folder_icon;
+
+ theme_icon(clip_vframe, clip_icon, "clip_icon");
+ theme_icon(atransition_vframe, atransition_icon, "atransition_icon");
+ theme_icon(vtransition_vframe, vtransition_icon, "vtransition_icon");
+ theme_icon(aeffect_vframe, aeffect_icon, "aeffect_icon");
+ theme_icon(veffect_vframe, veffect_icon, "veffect_icon");
+
+ plugin_icon(ladspa_vframe, ladspa_icon, "lad_picon", lad_picon_png);
+ plugin_icon(ff_aud_vframe, ff_aud_icon, "ff_audio", ff_audio_png);
+ plugin_icon(ff_vid_vframe, ff_vid_icon, "ff_video", ff_video_png);
+ folder_lock->lock("AWindowGUI::create_objects");
// Mandatory folders
folders.append(new AssetPicon(mwindow, this, AW_AEFFECT_FOLDER, 1));
folders.append(new AssetPicon(mwindow, this, AW_VEFFECT_FOLDER, 1));
folders.append(new AssetPicon(mwindow, this, AW_VTRANSITION_FOLDER, 1));
folders.append(new AssetPicon(mwindow, this, AW_LABEL_FOLDER, 1));
folders.append(new AssetPicon(mwindow, this, AW_CLIP_FOLDER, 1));
+ folders.append(new AssetPicon(mwindow, this, AW_PROXY_FOLDER, 1));
folders.append(new AssetPicon(mwindow, this, AW_MEDIA_FOLDER, 1));
create_label_folder();
-SET_TRACE
+ folder_lock->unlock();
mwindow->theme->get_awindow_sizes(this);
load_defaults(mwindow->defaults);
-SET_TRACE
- add_subwindow(asset_list = new AWindowAssets(mwindow,
- this,
- mwindow->theme->alist_x,
- mwindow->theme->alist_y,
- mwindow->theme->alist_w,
- mwindow->theme->alist_h));
+ int x1 = mwindow->theme->alist_x, y1 = mwindow->theme->alist_y;
+ int w1 = mwindow->theme->alist_w, h1 = mwindow->theme->alist_h;
+ search_text = new AWindowSearchText(mwindow, this, x1, y1+5);
+ search_text->create_objects();
+ int dy = search_text->get_h() + 10;
+ y1 += dy; h1 -= dy;
+ add_subwindow(asset_list = new AWindowAssets(mwindow, this, x1, y1, w1, h1));
vicon_thread = new VIconThread(asset_list);
vicon_thread->start();
+ vicon_audio = new AssetVIconAudio(this);
-SET_TRACE
- add_subwindow(divider = new AWindowDivider(mwindow,
- this,
- mwindow->theme->adivider_x,
- mwindow->theme->adivider_y,
- mwindow->theme->adivider_w,
- mwindow->theme->adivider_h));
+ add_subwindow(divider = new AWindowDivider(mwindow, this,
+ mwindow->theme->adivider_x, mwindow->theme->adivider_y,
+ mwindow->theme->adivider_w, mwindow->theme->adivider_h));
-SET_TRACE
divider->set_cursor(HSEPARATE_CURSOR, 0, 0);
-SET_TRACE
int fx = mwindow->theme->afolders_x, fy = mwindow->theme->afolders_y;
int fw = mwindow->theme->afolders_w, fh = mwindow->theme->afolders_h;
VFrame **images = mwindow->theme->get_image_set("playpatch_data");
add_subwindow(add_tools = new AddTools(mwindow, this, fx, fy, _("Visibility")));
add_tools->create_objects();
fy += add_tools->get_h(); fh -= add_tools->get_h();
-SET_TRACE
add_subwindow(folder_list = new AWindowFolders(mwindow,
this, fx, fy, fw, fh));
-SET_TRACE
update_effects();
-SET_TRACE
//int x = mwindow->theme->abuttons_x;
//int y = mwindow->theme->abuttons_y;
-SET_TRACE
newfolder_thread = new NewFolderThread(mwindow, this);
clip_menu->create_objects();
add_subwindow(label_menu = new LabelPopup(mwindow, this));
label_menu->create_objects();
+ add_subwindow(proxy_menu = new ProxyPopup(mwindow, this));
+ proxy_menu->create_objects();
add_subwindow(effectlist_menu = new EffectListMenu(mwindow, this));
effectlist_menu->create_objects();
cliplist_menu->create_objects();
add_subwindow(labellist_menu = new LabelListMenu(mwindow, this));
labellist_menu->create_objects();
-SET_TRACE
+ add_subwindow(proxylist_menu = new ProxyListMenu(mwindow, this));
+ proxylist_menu->create_objects();
add_subwindow(folderlist_menu = new FolderListMenu(mwindow, this));
folderlist_menu->create_objects();
-SET_TRACE
-//printf("AWindowGUI::create_objects 2\n");
create_custom_xatoms();
unlock_window();
void AWindowGUI::reposition_objects()
{
- asset_list->reposition_window(
- mwindow->theme->alist_x, mwindow->theme->alist_y,
- mwindow->theme->alist_w, mwindow->theme->alist_h);
+ int x1 = mwindow->theme->alist_x, y1 = mwindow->theme->alist_y;
+ int w1 = mwindow->theme->alist_w, h1 = mwindow->theme->alist_h;
+ search_text->reposition_window(x1, y1+5, w1);
+ int dy = search_text->get_h() + 10;
+ y1 += dy; h1 -= dy;
+ asset_list->reposition_window(x1, y1, w1, h1);
divider->reposition_window(
mwindow->theme->adivider_x, mwindow->theme->adivider_y,
mwindow->theme->adivider_w, mwindow->theme->adivider_h);
add_subwindow(title);
y += title->get_h() + 5;
list = new BC_ListBox(x, y,
- get_w() - 20, ok_button->get_y() - y - 5, LISTBOX_TEXT, &plugin_list,
- 0, 0, 1, 0, 0, LISTBOX_SINGLE, ICON_LEFT, 0);
+ get_w() - 20, ok_button->get_y() - y - 5, LISTBOX_TEXT, &plugin_list,
+ 0, 0, 1, 0, 0, LISTBOX_SINGLE, ICON_LEFT, 0);
add_subwindow(list);
show_window();
}
{
if( !result ) {
printf(_("remove %s\n"), plugin->path);
+ awindow->gui->lock_window("AWindowRemovePlugin::handle_close_event");
ArrayList<BC_ListBoxItem*> *folder =
plugin->audio ? plugin->transition ?
&awindow->gui->atransitions :
&awindow->gui->veffects :
0;
if( folder ) remove_plugin(plugin, *folder);
+ MWindow *mwindow = awindow->mwindow;
+ awindow->gui->unlock_window();
char plugin_path[BCTEXTLEN];
strcpy(plugin_path, plugin->path);
- MWindow *mwindow = awindow->mwindow;
mwindow->plugindb->remove(plugin);
remove(plugin_path);
char index_path[BCTEXTLEN];
- snprintf(index_path, sizeof(index_path), "%s/%s",
- mwindow->preferences->plugin_dir, PLUGIN_FILE);
+ mwindow->create_defaults_path(index_path, PLUGIN_FILE);
remove(index_path);
- char png_path[BCTEXTLEN];
- if( plugin->get_plugin_png_path(png_path, mwindow->preferences->plugin_icons) )
- remove(png_path);
- if( plugin->get_plugin_png_path(png_path, DEFAULT_PICON) )
+ char picon_path[BCTEXTLEN];
+ FileSystem fs;
+ snprintf(picon_path, sizeof(picon_path), "%s/picon",
+ File::get_plugin_path());
+ char png_name[BCSTRLEN], png_path[BCTEXTLEN];
+ plugin->get_plugin_png_name(png_name);
+ fs.update(picon_path);
+ for( int i=0; i<fs.dir_list.total; ++i ) {
+ char *fs_path = fs.dir_list[i]->path;
+ if( !fs.is_dir(fs_path) ) continue;
+ snprintf(png_path, sizeof(picon_path), "%s/%s",
+ fs_path, png_name);
remove(png_path);
+ }
delete plugin; plugin = 0;
awindow->gui->async_update_assets();
}
return 1;
}
break;
+ case 'o':
+ if( !ctrl_down() && !shift_down() ) {
+ assetlist_menu->load_file->handle_event();
+ return 1;
+ }
+ break;
case DELETE:
if( shift_down() ) {
PluginServer* plugin = selected_plugin();
}
-
-
-
-
-
void AWindowGUI::update_folder_list()
{
- stop_vicon_drawing();
-//printf("AWindowGUI::update_folder_list 1\n");
for( int i = 0; i < folders.total; i++ ) {
AssetPicon *picon = (AssetPicon*)folders.values[i];
- picon->in_use--;
+ picon->in_use = 0;
}
-//printf("AWindowGUI::update_folder_list 1\n");
// Search assets for folders
for( int i = 0; i < mwindow->edl->folders.total; i++ ) {
const char *folder = mwindow->edl->folders.values[i];
int exists = 0;
-//printf("AWindowGUI::update_folder_list 1.1\n");
for( int j = 0; j < folders.total; j++ ) {
AssetPicon *picon = (AssetPicon*)folders.values[j];
if( !exists ) {
int aw_folder = folder_number(folder);
- AssetPicon *picon = aw_folder >= 0 ?
- new AssetPicon(mwindow, this, aw_folder, 0) :
- new AssetPicon(mwindow, this, folder, AW_USER_FOLDER);
- picon->create_objects();
- folders.append(picon);
+ if( aw_folder >= 0 ) {
+ AssetPicon *picon = new AssetPicon(mwindow, this, aw_folder, 1);
+ picon->create_objects();
+ folders.append(picon);
+ }
}
-//printf("AWindowGUI::update_folder_list 1.3\n");
}
-//printf("AWindowGUI::update_folder_list 1\n");
-//for( int i = 0; i < folders.total; i++ )
-// printf("AWindowGUI::update_folder_list %s\n", folders.values[i]->get_text());
-// Delete excess
- for( int i = folders.total - 1; i >= 0; i-- ) {
+// Delete unused non-persistent folders
+ for( int i=folders.total; --i>=0; ) {
AssetPicon *picon = (AssetPicon*)folders.values[i];
if( !picon->in_use && !picon->persistent ) {
delete picon;
folders.remove_number(i);
}
}
-//for( int i = 0; i < folders.total; i++ )
-// printf("AWindowGUI::update_folder_list %s\n", folders.values[i]->get_text());
-//printf("AWindowGUI::update_folder_list 2\n");
- start_vicon_drawing();
}
void AWindowGUI::create_persistent_folder(ArrayList<BC_ListBoxItem*> *output,
void AWindowGUI::update_asset_list()
{
-//printf("AWindowGUI::update_asset_list 1\n");
+ ArrayList<AssetPicon *> new_assets;
for( int i = 0; i < assets.total; i++ ) {
AssetPicon *picon = (AssetPicon*)assets.values[i];
- picon->in_use--;
+ picon->in_use = 0;
}
-
-
-
-
-//printf("AWindowGUI::update_asset_list 2\n");
-
-
+ mwindow->gui->lock_window("AWindowGUI::update_asset_list");
// Synchronize EDL clips
- for( int i = 0; i < mwindow->edl->clips.total; i++ ) {
+ for( int i=0; i<mwindow->edl->clips.size(); ++i ) {
int exists = 0;
// Look for clip in existing listitems
for( int j = 0; j < assets.total && !exists; j++ ) {
AssetPicon *picon = (AssetPicon*)assets.values[j];
- if( picon->id == mwindow->edl->clips.values[i]->id ) {
- picon->edl = mwindow->edl->clips.values[i];
- picon->set_text(mwindow->edl->clips.values[i]->local_session->clip_title);
+ if( picon->id == mwindow->edl->clips[i]->id ) {
+ picon->edl = mwindow->edl->clips[i];
+ picon->set_text(mwindow->edl->clips[i]->local_session->clip_title);
exists = 1;
picon->in_use = 1;
}
// Create new listitem
if( !exists ) {
AssetPicon *picon = new AssetPicon(mwindow,
- this,
- mwindow->edl->clips.values[i]);
- picon->create_objects();
- assets.append(picon);
+ this, mwindow->edl->clips[i]);
+ new_assets.append(picon);
}
}
-
-
-
-
-//printf("AWindowGUI::update_asset_list %d\n", __LINE__);
-
-
// Synchronize EDL assets
- for( Asset *current = mwindow->edl->assets->first;
- current;
- current = NEXT ) {
+ for( Asset *current=mwindow->edl->assets->first; current; current=NEXT ) {
int exists = 0;
// Look for asset in existing listitems
if( picon->id == current->id ) {
picon->indexable = current;
- exists = 1;
picon->in_use = 1;
- break;
+ exists = 1;
}
}
// Create new listitem
if( !exists ) {
-//printf("AWindowGUI::update_asset_list %d\n", __LINE__);
- AssetPicon *picon = new AssetPicon(mwindow, this, current);
-//printf("AWindowGUI::update_asset_list %d\n", __LINE__);
- picon->create_objects();
-//printf("AWindowGUI::update_asset_list %d\n", __LINE__);
- assets.append(picon);
+ AssetPicon *picon = new AssetPicon(mwindow,
+ this, current);
+ new_assets.append(picon);
}
}
- mwindow->gui->lock_window("AWindowGUI::update_asset_list");
- mwindow->gui->default_message();
- mwindow->gui->unlock_window();
-
-//printf("AWindowGUI::update_asset_list %d\n", __LINE__);
-
-
// Synchronize nested EDLs
- for( int i = 0; i < mwindow->edl->nested_edls->size(); i++ ) {
+ for( int i=0; i<mwindow->edl->nested_edls.size(); ++i ) {
int exists = 0;
- Indexable *indexable = mwindow->edl->nested_edls->get(i);
+ EDL *nested_edl = mwindow->edl->nested_edls[i];
// Look for asset in existing listitems
- for( int j = 0; j < assets.total && !exists; j++ ) {
+ for( int j=0; j<assets.total && !exists; ++j ) {
AssetPicon *picon = (AssetPicon*)assets.values[j];
- if( picon->id == indexable->id ) {
- picon->indexable = indexable;
- exists = 1;
+ if( picon->id == nested_edl->id ) {
+ picon->indexable = nested_edl;
picon->in_use = 1;
- break;
+ exists = 1;
}
}
// Create new listitem
if( !exists ) {
AssetPicon *picon = new AssetPicon(mwindow,
- this,
- indexable);
- picon->create_objects();
- assets.append(picon);
+ this, (Indexable*)nested_edl);
+ new_assets.append(picon);
}
}
+ mwindow->gui->unlock_window();
+ for( int i=0; i<new_assets.size(); ++i ) {
+ AssetPicon *picon = new_assets[i];
+ picon->create_objects();
+ assets.append(picon);
+ }
+ mwindow->gui->lock_window();
+ mwindow->gui->default_message();
+ mwindow->gui->unlock_window();
-
-
-
-
-
-
-//printf("AWindowGUI::update_asset_list %d\n", __LINE__);
for( int i = assets.size() - 1; i >= 0; i-- ) {
AssetPicon *picon = (AssetPicon*)assets.get(i);
-//printf("AWindowGUI::update_asset_list %s %d\n", picon->asset->path, picon->in_use);
if( !picon->in_use ) {
delete picon;
assets.remove_number(i);
+ continue;
}
+ if( !picon->indexable || !picon->indexable->is_asset ) continue;
+ struct stat st;
+ picon->mtime = !stat(picon->indexable->path, &st) ? st.st_mtime : 0;
}
-//printf("AWindowGUI::update_asset_list 7 %d\n", assets.total);
}
void AWindowGUI::update_picon(Indexable *indexable)
{
-//printf("AWindowGUI::update_asset_list 1\n");
VIcon *vicon = 0;
for( int i = 0; i < assets.total; i++ ) {
AssetPicon *picon = (AssetPicon*)assets.values[i];
}
}
-void AWindowGUI::sort_assets()
+void AWindowGUI::sort_assets(int use_mtime)
{
-//printf("AWindowGUI::sort_assets 1 %s\n", mwindow->edl->session->current_folder);
+ folder_lock->lock("AWindowGUI::sort_assets");
switch( mwindow->edl->session->awindow_folder ) {
case AW_AEFFECT_FOLDER:
sort_picons(&aeffects);
sort_picons(&labellist);
break;
default:
- sort_picons(&assets);
+ sort_picons(&assets, use_mtime);
+ break;
}
+// reset xyposition
+ asset_list->update_format(asset_list->get_format(), 0);
+ folder_lock->unlock();
+ update_assets();
+}
+void AWindowGUI::sort_folders()
+{
+ folder_lock->lock("AWindowGUI::update_assets");
+ sort_picons(&folders);
+ folder_list->update_format(folder_list->get_format(), 0);
+ folder_lock->unlock();
update_assets();
}
-void AWindowGUI::collect_assets()
+EDL *AWindowGUI::collect_proxy(Indexable *indexable)
+{
+ Asset *proxy_asset = (Asset *)indexable;
+ char path[BCTEXTLEN];
+ int proxy_scale = mwindow->edl->session->proxy_scale;
+ ProxyRender::from_proxy_path(path, proxy_asset, proxy_scale);
+ Asset *unproxy_asset = mwindow->edl->assets->get_asset(path);
+ if( !unproxy_asset || !unproxy_asset->channels ) return 0;
+// make a clip from proxy video tracks and unproxy audio tracks
+ EDL *proxy_edl = new EDL(mwindow->edl);
+ proxy_edl->create_objects();
+ FileSystem fs; fs.extract_name(path, proxy_asset->path);
+ proxy_edl->set_path(path);
+ strcpy(proxy_edl->local_session->clip_title, path);
+ strcpy(proxy_edl->local_session->clip_notes, _("Proxy clip"));
+ proxy_edl->session->video_tracks = proxy_asset->layers;
+ proxy_edl->session->audio_tracks = unproxy_asset->channels;
+ proxy_edl->create_default_tracks();
+ double length = proxy_asset->frame_rate > 0 ?
+ (double)proxy_asset->video_length / proxy_asset->frame_rate :
+ 1.0 / mwindow->edl->session->frame_rate;
+ Track *current = proxy_edl->tracks->first;
+ for( int vtrack=0; current; current=NEXT ) {
+ if( current->data_type != TRACK_VIDEO ) continue;
+ current->insert_asset(proxy_asset, 0, length, 0, vtrack++);
+ }
+ length = (double)unproxy_asset->audio_length / unproxy_asset->sample_rate;
+ current = proxy_edl->tracks->first;
+ for( int atrack=0; current; current=NEXT ) {
+ if( current->data_type != TRACK_AUDIO ) continue;
+ current->insert_asset(unproxy_asset, 0, length, 0, atrack++);
+ }
+ return proxy_edl;
+}
+
+
+void AWindowGUI::collect_assets(int proxy)
{
- int i = 0;
mwindow->session->drag_assets->remove_all();
mwindow->session->drag_clips->remove_all();
- while(1)
- {
- AssetPicon *result = (AssetPicon*)asset_list->get_selection(0, i++);
- if( !result ) break;
-
- if( result->indexable ) mwindow->session->drag_assets->append(result->indexable);
- if( result->edl ) mwindow->session->drag_clips->append(result->edl);
+ mwindow->session->clear_drag_proxy();
+ int i = 0; AssetPicon *result;
+ while( (result = (AssetPicon*)asset_list->get_selection(0, i++)) != 0 ) {
+ Indexable *indexable = result->indexable; EDL *drag_edl;
+ if( proxy && (drag_edl=collect_proxy(indexable)) ) {
+ mwindow->session->drag_clips->append(drag_edl);
+ mwindow->session->drag_proxy->append(drag_edl);
+ continue;
+ }
+ if( indexable ) {
+ mwindow->session->drag_assets->append(indexable);
+ continue;
+ }
+ if( result->edl ) {
+ mwindow->session->drag_clips->append(result->edl);
+ continue;
+ }
}
}
dst[1].remove_all_objects();
// Create new pointers
-//if( folder ) printf("AWindowGUI::copy_picons 1 %s\n", folder);
for( int i = 0; i < src->total; i++ ) {
AssetPicon *picon = (AssetPicon*)src->values[i];
-//printf("AWindowGUI::copy_picons 2 %s\n", picon->asset->folder);
if( folder < 0 ||
(picon->indexable && picon->indexable->awindow_folder == folder) ||
(picon->edl && picon->edl->local_session->awindow_folder == folder) ) {
+ const char *text = search_text->get_text();
+ int hidden = text && text[0] && !bstrcasestr(picon->get_text(), text);
+ if( picon->vicon ) picon->vicon->hidden = hidden;
+ if( hidden ) continue;
BC_ListBoxItem *item2, *item1;
dst[0].append(item1 = picon);
if( picon->edl )
dst[1].append(item2 = new BC_ListBoxItem(picon->edl->local_session->clip_notes));
else
- if( picon->label && picon->label->textstr )
+ if( picon->label )
dst[1].append(item2 = new BC_ListBoxItem(picon->label->textstr));
+ else if( picon->mtime ) {
+ char date_time[BCSTRLEN];
+ struct tm stm; localtime_r(&picon->mtime, &stm);
+ sprintf(date_time,"%04d.%02d.%02d %02d:%02d:%02d",
+ stm.tm_year+1900, stm.tm_mon+1, stm.tm_mday,
+ stm.tm_hour, stm.tm_min, stm.tm_sec);
+ dst[1].append(item2 = new BC_ListBoxItem(date_time));
+ }
else
dst[1].append(item2 = new BC_ListBoxItem(""));
- item1->set_autoplace_text(1);
- item2->set_autoplace_text(1);
-//printf("AWindowGUI::copy_picons 3 %s\n", picon->get_text());
+ item1->set_autoplace_text(1); item1->set_autoplace_icon(1);
+ item2->set_autoplace_text(1); item2->set_autoplace_icon(1);
}
}
}
-void AWindowGUI::sort_picons(ArrayList<BC_ListBoxItem*> *src)
+void AWindowGUI::sort_picons(ArrayList<BC_ListBoxItem*> *src, int use_mtime)
{
-//printf("AWindowGUI::sort_picons 1\n")
- int done = 0;
- while(!done)
- {
+ int done = 0, changed = 0;
+ while( !done ) {
done = 1;
- for( int i = 0; i < src->total - 1; i++ ) {
- BC_ListBoxItem *item1 = src->values[i];
- BC_ListBoxItem *item2 = src->values[i + 1];
- item1->set_autoplace_icon(1);
- item2->set_autoplace_icon(1);
- item1->set_autoplace_text(1);
- item2->set_autoplace_text(1);
- if( strcmp(item1->get_text(), item2->get_text()) > 0 ) {
+ for( int i=0; i<src->total-1; ++i ) {
+ AssetPicon *item1 = (AssetPicon *)src->values[i];
+ AssetPicon *item2 = (AssetPicon *)src->values[i + 1];
+ if( use_mtime ? item1->mtime > item2->mtime :
+ strcmp(item1->get_text(), item2->get_text()) > 0 ) {
src->values[i + 1] = item1;
src->values[i] = item2;
- done = 0;
+ done = 0; changed = 1;
}
}
}
+ if( changed ) {
+ for( int i=0; i<src->total; ++i ) {
+ AssetPicon *item = (AssetPicon *)src->values[i];
+ item->set_autoplace_icon(1);
+ item->set_autoplace_text(1);
+ }
+ }
}
void AWindowGUI::filter_displayed_assets()
{
//allow_iconlisting = 1;
- asset_titles[0] = _("Title");
+ asset_titles[0] = C_("Title");
asset_titles[1] = _("Comments");
switch( mwindow->edl->session->awindow_folder ) {
case AW_LABEL_FOLDER:
copy_picons(displayed_assets, &labellist, AW_NO_FOLDER);
asset_titles[0] = _("Time Stamps");
- asset_titles[1] = _("Title");
+ asset_titles[1] = C_("Title");
//allow_iconlisting = 0;
break;
default:
}
// Ensure the current folder icon is highlighted
- for( int i = 0; i < folders.total; i++ )
- folders.values[i]->set_selected(0);
-
- folders.values[mwindow->edl->session->awindow_folder]->set_selected(1);
+ int selected_folder = mwindow->edl->session->awindow_folder;
+ for( int i = 0; i < folders.total; i++ ) {
+ AssetPicon *folder_item = (AssetPicon *)folders.values[i];
+ int selected = folder_item->foldernum == selected_folder ? 1 : 0;
+ folder_item->set_selected(selected);
+ }
}
void AWindowGUI::update_assets()
{
-//printf("AWindowGUI::update_assets 1\n");
+ stop_vicon_drawing();
+ folder_lock->lock("AWindowGUI::update_assets");
update_folder_list();
-//printf("AWindowGUI::update_assets 2\n");
update_asset_list();
labellist.remove_all_objects();
create_label_folder();
-//printf("AWindowGUI::update_assets 3\n");
+
+ if( displayed_folder != mwindow->edl->session->awindow_folder )
+ search_text->clear();
filter_displayed_assets();
+ folder_lock->unlock();
-//printf("AWindowGUI::update_assets 4\n");
if( mwindow->edl->session->folderlist_format != folder_list->get_format() ) {
folder_list->update_format(mwindow->edl->session->folderlist_format, 0);
}
int folder_yposition = folder_list->get_yposition();
folder_list->update(&folders, 0, 0, 1, folder_xposition, folder_yposition, -1);
-//printf("AWindowGUI::update_assets 5\n");
if( mwindow->edl->session->assetlist_format != asset_list->get_format() ) {
asset_list->update_format(mwindow->edl->session->assetlist_format, 0);
}
mwindow->edl->session->asset_columns, ASSET_COLUMNS,
asset_xposition, asset_yposition, -1, 0);
asset_list->center_selection();
-//printf("AWindowGUI::update_assets 7\n");
flush();
-//printf("AWindowGUI::update_assets 8\n");
+ start_vicon_drawing();
return;
}
int AWindowGUI::drag_stop()
{
if( get_hidden() ) return 0;
-
return 0;
}
gui->folderlist_menu->activate_menu();
}
- mwindow->edl->session->awindow_folder = picon->foldernum;
-//printf("AWindowFolders::selection_changed 1\n");
+ mwindow->edl->session->awindow_folder = picon->foldernum;
gui->asset_list->draw_background();
gui->async_update_assets();
0, // If this listbox is a popup window
LISTBOX_MULTIPLE, // Select one item or multiple items
ICON_TOP, // Position of icon relative to text of each item
- 1) // Allow drag
+ -1) // Allow drags, require shift for scrolling
{
this->mwindow = mwindow;
this->gui = gui;
gui->cliplist_menu->update();
gui->cliplist_menu->activate_menu();
break;
+ case AW_PROXY_FOLDER:
+ gui->proxylist_menu->update();
+ gui->proxylist_menu->activate_menu();
+ break;
case AW_MEDIA_FOLDER:
- gui->assetlist_menu->update_titles();
+ gui->assetlist_menu->update_titles(folder==AW_MEDIA_FOLDER);
gui->assetlist_menu->activate_menu();
break;
}
int AWindowAssets::handle_event()
{
-//printf("AWindowAssets::handle_event 1 %d %d\n", get_buttonpress(), get_selection(0, 0));
AssetPicon *asset_picon = (AssetPicon *)get_selection(0, 0);
if( !asset_picon ) return 0;
+ Indexable *picon_idxbl = asset_picon->indexable;
+ EDL *picon_edl = asset_picon->edl;
+ int proxy = 0;
+ VWindow *vwindow = 0;
switch( mwindow->edl->session->awindow_folder ) {
case AW_AEFFECT_FOLDER:
case AW_VEFFECT_FOLDER:
case AW_ATRANSITION_FOLDER:
case AW_VTRANSITION_FOLDER: return 1;
+ case AW_PROXY_FOLDER:
+ proxy = 1; // fall thru
+ default:
+ if( mwindow->vwindows.size() > DEFAULT_VWINDOW )
+ vwindow = mwindow->vwindows.get(DEFAULT_VWINDOW);
+ break;
}
- VWindow *vwindow = mwindow->vwindows.size() > DEFAULT_VWINDOW ?
- mwindow->vwindows.get(DEFAULT_VWINDOW) : 0;
if( !vwindow || !vwindow->is_running() ) return 1;
-//printf("AWindowAssets::handle_event 2 %d %d\n", get_buttonpress(), get_selection(0, 0));
-
- vwindow->gui->lock_window("AWindowAssets::handle_event");
- if( asset_picon->indexable )
- vwindow->change_source(asset_picon->indexable);
- else if( asset_picon->edl )
- vwindow->change_source(asset_picon->edl);
- vwindow->gui->unlock_window();
+ if( proxy && picon_idxbl ) {
+ picon_edl = gui->collect_proxy(picon_idxbl);
+ picon_idxbl = 0;
+ }
+
+ if( picon_idxbl ) vwindow->change_source(picon_idxbl);
+ else if( picon_edl ) vwindow->change_source(picon_edl);
return 1;
}
gui->clip_menu->update();
gui->clip_menu->activate_menu();
break;
+ case AW_PROXY_FOLDER:
+ if( !item->indexable && !item->edl ) break;
+ gui->proxy_menu->update();
+ gui->proxy_menu->activate_menu();
+ break;
default:
if( !item->indexable && !item->edl ) break;
gui->asset_menu->update();
BC_ListBox::deactivate_selection();
return 1;
}
- else if( get_button_down() && get_buttonpress() == 1 &&
+ else if( gui->vicon_drawing &&
+ get_button_down() && get_buttonpress() == 1 &&
(item = (AssetPicon*)get_selection(0, 0)) ) {
VIcon *vicon = 0;
if( !gui->vicon_thread->viewing ) {
int AWindowAssets::drag_start_event()
{
int collect_pluginservers = 0;
- int collect_assets = 0;
+ int collect_assets = 0, proxy = 0;
if( BC_ListBox::drag_start_event() ) {
switch( mwindow->edl->session->awindow_folder ) {
case AW_LABEL_FOLDER:
// do nothing!
break;
+ case AW_PROXY_FOLDER:
+ proxy = 1;
+ // fall thru
+ case AW_MEDIA_FOLDER:
default:
mwindow->session->current_operation = DRAG_ASSET;
collect_assets = 1;
}
if( collect_assets ) {
- gui->collect_assets();
+ gui->collect_assets(proxy);
}
return 1;
lock_window("AWindowAssets::drag_stop_event");
- if( result ) get_drag_popup()->set_animation(0);
+ if( result )
+ get_drag_popup()->set_animation(0);
BC_ListBox::drag_stop_event();
- mwindow->session->current_operation = ::NO_OPERATION; // since NO_OPERATION is also defined in listbox, we have to reach for global scope...
- return 0;
+// since NO_OPERATION is also defined in listbox, we have to reach for global scope...
+ mwindow->session->current_operation = ::NO_OPERATION;
+ mwindow->session->clear_drag_proxy();
+
+ return 1;
}
int AWindowAssets::column_resize_event()
return BC_ListBox::focus_out_event();
}
+AWindowSearchTextBox::AWindowSearchTextBox(AWindowSearchText *search_text, int x, int y, int w)
+ : BC_TextBox(x, y, w, 1, "")
+{
+ this->search_text = search_text;
+}
+int AWindowSearchTextBox::handle_event()
+{
+ return search_text->handle_event();
+}
+AWindowSearchText::AWindowSearchText(MWindow *mwindow, AWindowGUI *gui, int x, int y)
+{
+ this->mwindow = mwindow;
+ this->gui = gui;
+ this->x = x;
+ this->y = y;
+}
+void AWindowSearchText::create_objects()
+{
+ int x1 = x, y1 = y, margin = 10;
+ gui->add_subwindow(text_title = new BC_Title(x1, y1, _("Search:")));
+ x1 += text_title->get_w() + margin;
+ int w1 = gui->get_w() - x1 - 2*margin;
+ gui->add_subwindow(text_box = new AWindowSearchTextBox(this, x1, y1, w1));
+}
+int AWindowSearchText::handle_event()
+{
+ gui->async_update_assets();
+ return 1;
+}
+int AWindowSearchText::get_w()
+{
+ return text_box->get_w() + text_title->get_w() + 10;
+}
+int AWindowSearchText::get_h()
+{
+ return bmax(text_box->get_h(),text_title->get_h());
+}
+void AWindowSearchText::reposition_window(int x, int y, int w)
+{
+ int x1 = x, y1 = y, margin = 10;
+ text_title->reposition_window(x1, y1);
+ x1 += text_title->get_w() + margin;
+ int w1 = gui->get_w() - x1 - 2*margin;
+ text_box->reposition_window(x1, y1, w1);
+}
+const char *AWindowSearchText::get_text()
+{
+ return text_box->get_text();
+}
-
+void AWindowSearchText::clear()
+{
+ text_box->update("");
+}
AWindowNewFolder::AWindowNewFolder(MWindow *mwindow, AWindowGUI *gui, int x, int y)
: BC_Button(x, y, mwindow->theme->newbin_data)
return 1;
}
-AWindowInfo::AWindowInfo(MWindow *mwindow, AWindowGUI *gui, int x, int y)
- : BC_Button(x, y, mwindow->theme->infoasset_data)
-{
- this->mwindow = mwindow;
- this->gui = gui;
- set_tooltip(_("Edit information on asset"));
-}
-
-int AWindowInfo::handle_event()
-{
- int cur_x, cur_y;
- gui->get_abs_cursor_xy(cur_x, cur_y, 0);
- gui->awindow->asset_edit->edit_asset(gui->selected_asset(), cur_x, cur_y);
- return 1;
-}
+// AWindowInfo::AWindowInfo(MWindow *mwindow, AWindowGUI *gui, int x, int y)
+// : BC_Button(x, y, mwindow->theme->infoasset_data)
+// {
+// this->mwindow = mwindow;
+// this->gui = gui;
+// set_tooltip(_("Edit information on asset"));
+// }
+//
+// int AWindowInfo::handle_event()
+// {
+// int cur_x, cur_y;
+// gui->get_abs_cursor(cur_x, cur_y, 0);
+// gui->awindow->asset_edit->edit_asset(gui->selected_asset(), cur_x, cur_y);
+// return 1;
+// }
AWindowRedrawIndex::AWindowRedrawIndex(MWindow *mwindow, AWindowGUI *gui, int x, int y)
: BC_Button(x, y, mwindow->theme->redrawindex_data)
void AddTools::create_objects()
{
uint64_t vis = 0;
- add_item(new AddPluginItem(this, "ladspa", PLUGIN_LADSPA_ID));
- vis |= 1 << PLUGIN_LADSPA_ID;
add_item(new AddPluginItem(this, "ffmpeg", PLUGIN_FFMPEG_ID));
vis |= 1 << PLUGIN_FFMPEG_ID;
+ add_item(new AddPluginItem(this, "ladspa", PLUGIN_LADSPA_ID));
+ vis |= 1 << PLUGIN_LADSPA_ID;
+#ifdef HAVE_LV2
+ add_item(new AddPluginItem(this, "lv2", PLUGIN_LV2_ID));
+ vis |= 1 << PLUGIN_LV2_ID;
+#endif
for( int i=0; i<MWindow::plugindb->size(); ++i ) {
PluginServer *plugin = MWindow::plugindb->get(i);
if( !plugin->audio && !plugin->video ) continue;
#if 0
// plugin_dirs list from toplevel makefile include plugin_defs
-N_("ladspa")
N_("ffmpeg")
+N_("ladspa")
+N_("lv2")
N_("audio_tools")
N_("audio_transitions")
N_("blending")
this->idx = idx;
uint64_t msk = (uint64_t)1 << idx, vis = menu->gui->plugin_visibility;
int chk = (msk & vis) ? 1 : 0;
- set_checked(chk);
+ set_checked(chk);
}
int AddPluginItem::handle_event()
{
- int chk = get_checked() ^ 1;
- set_checked(chk);
+ int chk = get_checked() ^ 1;
+ set_checked(chk);
uint64_t msk = (uint64_t)1 << idx, vis = menu->gui->plugin_visibility;
menu->gui->plugin_visibility = chk ? vis | msk : vis & ~msk;
menu->gui->update_effects();
void AWindowListFormat::update()
{
- set_text(mwindow->edl->session->assetlist_format == ASSETS_TEXT ?
- (char*)_("Display icons") : (char*)_("Display text"));
+ set_text(mwindow->edl->session->assetlist_format == ASSETS_TEXT ?
+ (char*)_("Display icons") : (char*)_("Display text"));
}
AWindowListSort::AWindowListSort(MWindow *mwindow, AWindowGUI *gui)
int AWindowListSort::handle_event()
{
- gui->sort_assets();
+ gui->sort_assets(0);
return 1;
}
-