add_item(new ViewPluginIconItem(this, DEFAULT_PICON));
FileSystem fs;
const char *plugin_path = File::get_plugin_path();
- if( fs.update(plugin_path) ) return;
+ char picon_path[BCTEXTLEN];
+ snprintf(picon_path,sizeof(picon_path)-1,"%s/picon", plugin_path);
+ if( fs.update(picon_path) ) return;
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;
char *cp = strrchr(fs_path,'/');
cp = !cp ? fs_path : cp+1;
- if( strncmp("picon_", cp, 6) ) continue;
- if( !strcmp(cp += 6,DEFAULT_PICON) ) continue;
+ if( !strcmp(cp,DEFAULT_PICON) ) continue;
add_item(new ViewPluginIconItem(this, cp));
}
}
keyframe_data[0].append(new BC_ListBoxItem(hash.get_key(i)));
keyframe_data[1].append(new BC_ListBoxItem(hash.get_value(i)));
}
- keyframe_data[0].append(new BC_ListBoxItem((char*)"TEXT"));
- keyframe_data[1].append(new BC_ListBoxItem(text));
- keyframe_data[0].append(new BC_ListBoxItem((char*)"DATA"));
- keyframe_data[1].append(new BC_ListBoxItem(data));
-
+ if( text ) {
+ keyframe_data[0].append(new BC_ListBoxItem((char*)"TEXT"));
+ keyframe_data[1].append(new BC_ListBoxItem(text));
+ }
+ if( data ) {
+ keyframe_data[0].append(new BC_ListBoxItem((char*)"DATA"));
+ keyframe_data[1].append(new BC_ListBoxItem(data));
+ }
delete [] text;
delete [] data;
}
return 1;
}
+PluginPresetEdit::PluginPresetEdit(MWindow *mwindow, int x, int y, Plugin *plugin)
+ : BC_Button(x, y, mwindow->theme->get_image_set("preset_edit"))
+{
+ this->mwindow = mwindow;
+ this->plugin = plugin;
+ in_use = 1;
+ set_tooltip(_("Preset Edit"));
+}
+int PluginPresetEdit::handle_event()
+{
+ mwindow->show_keyframe_gui(plugin);
+ return 1;
+}
+int PluginPresetEdit::calculate_w(MWindow *mwindow)
+{
+ VFrame **images = mwindow->theme->get_image_set("preset_edit");
+ return images[0]->get_w();
+}
+void PluginPresetEdit::update(int x, int y, Plugin *plugin)
+{
+ reposition_window(x, y);
+ this->plugin = plugin;
+ in_use = 1;
+}
};
-
class PluginShow : public BC_Toggle
{
public:
};
-
+class PluginPresetEdit : public BC_Button
+{
+public:
+ PluginPresetEdit(MWindow *mwindow, int x, int y, Plugin *plugin);
+ MWindow *mwindow;
+ static int calculate_w(MWindow *mwindow);
+ void update(int x, int y, Plugin *plugin);
+ int handle_event();
+ int in_use;
+ Plugin *plugin;
+};
#endif
class PluginOn;
class PluginShow;
-
+class PluginPresetEdit;
#endif
char string[BCTEXTLEN];
int current_on = 0;
int current_show = 0;
-
+ int current_preset = 0;
// if(!mwindow->edl->session->show_assets) goto done;
plugin_on_toggles.values[i]->in_use = 0;
for(int i = 0; i < plugin_show_toggles.total; i++)
plugin_show_toggles.values[i]->in_use = 0;
+ for(int i = 0; i < preset_edit_buttons.total; i++)
+ plugin_show_toggles.values[i]->in_use = 0;
for(Track *track = mwindow->edl->tracks->first;
}
current_show++;
}
-
-
-
+ toggle_x -= PluginPresetEdit::calculate_w(mwindow) + 10;
+ if(toggle_x > min_x)
+ {
+ if(current_preset >= preset_edit_buttons.total)
+ {
+ PluginPresetEdit *preset_edit = new PluginPresetEdit(mwindow, toggle_x, toggle_y, plugin);
+ add_subwindow(preset_edit);
+ preset_edit_buttons.append(preset_edit);
+ }
+ else
+ {
+ preset_edit_buttons.values[current_preset]->update(toggle_x, toggle_y, plugin);
+ }
+ current_preset++;
+ }
}
}
}
// Remove unused toggles
+ while(current_preset < preset_edit_buttons.total)
+ {
+ preset_edit_buttons.remove_object_number(current_preset);
+ }
while(current_show < plugin_show_toggles.total)
{
plugin_show_toggles.remove_object_number(current_show);
{
plugin_on_toggles.remove_object_number(current_on);
}
-
}
void TrackCanvas::refresh_plugintoggles()
PluginShow *show = plugin_show_toggles.values[i];
show->reposition_window(show->get_x(), show->get_y());
}
+ for(int i = 0; i < preset_edit_buttons.total; i++)
+ {
+ PluginPresetEdit *preset_edit = preset_edit_buttons.values[i];
+ preset_edit->reposition_window(preset_edit->get_x(), preset_edit->get_y());
+ }
}
void TrackCanvas::draw_inout_points()
// Plugin toggle interfaces
ArrayList<PluginOn*> plugin_on_toggles;
ArrayList<PluginShow*> plugin_show_toggles;
+ ArrayList<PluginPresetEdit*> preset_edit_buttons;
static int auto_operations[];
// event handlers
flush();
return 1;
}
+int BC_DragWindow::button_release_event()
+{
+ cursor_motion_event();
+ sync();
+ return BC_WindowBase::button_release_event();
+}
int BC_DragWindow::get_offset_x()
{
~BC_DragWindow();
int cursor_motion_event();
+ int button_release_event();
int drag_failure_event();
int get_offset_x();
int get_offset_y();
static inline char *msgqual(const char *msgqual,const char *msgid)
{
- if( !msgqual || *msgqual ) return gettext(msgid);
+ if( !msgqual || !*msgqual ) return gettext(msgid);
char msg[strlen(msgid) + strlen(msgqual) + 2], *cp = msg;
for( const char *bp=msgqual; *bp!=0; *cp++=*bp++ );
*cp++ = '#';
"shbtn_hi.png",
"shbtn_dn.png");
+ new_image_set("preset_edit",
+ 3,
+ "preset_edit0.png",
+ "preset_edit1.png",
+ "preset_edit2.png");
+
new_image_set("histogram_carrot",
5,
"histogram_carrot_up.png",
"shbtn_hi.png",
"shbtn_dn.png");
+ new_image_set("preset_edit",
+ 3,
+ "preset_edit0.png",
+ "preset_edit1.png",
+ "preset_edit2.png");
+
statusbar_cancel_data = new_image_set(3,
"statusbar_cancel_up.png",
"statusbar_cancel_hi.png",
"shbtn_hi.png",
"shbtn_dn.png");
+ new_image_set("preset_edit",
+ 3,
+ "preset_edit0.png",
+ "preset_edit1.png",
+ "preset_edit2.png");
+
new_image_set("histogram_carrot",
5,
"histogram_carrot_up.png",
"shbtn_hi.png",
"shbtn_dn.png");
+ new_image_set("preset_edit",
+ 3,
+ "preset_edit0.png",
+ "preset_edit1.png",
+ "preset_edit2.png");
+
statusbar_cancel_data = new_image_set(3,
"statusbar_cancel_up.png",
"statusbar_cancel_hi.png",
"shbtn_hi.png",
"shbtn_dn.png");
+ new_image_set("preset_edit",
+ 3,
+ "preset_edit0.png",
+ "preset_edit1.png",
+ "preset_edit2.png");
+
new_image_set("histogram_carrot",
5,
"histogram_carrot_up.png",
"shbtn_hi.png",
"shbtn_dn.png");
+ new_image_set("preset_edit",
+ 3,
+ "preset_edit0.png",
+ "preset_edit1.png",
+ "preset_edit2.png");
+
new_image_set("histogram_carrot",
5,
"histogram_carrot_up.png",
"shbtn_hi.png",
"shbtn_dn.png");
+ new_image_set("preset_edit",
+ 3,
+ "preset_edit0.png",
+ "preset_edit1.png",
+ "preset_edit2.png");
+
new_image_set("histogram_carrot",
5,
"histogram_carrot_up.png",
"shbtn_hi.png",
"shbtn_dn.png");
+ new_image_set("preset_edit",
+ 3,
+ "preset_edit0.png",
+ "preset_edit1.png",
+ "preset_edit2.png");
+
new_image_set("histogram_carrot",
5,
"histogram_carrot_up.png",
"shbtn_hi.png",
"shbtn_dn.png");
+ new_image_set("preset_edit",
+ 3,
+ "preset_edit0.png",
+ "preset_edit1.png",
+ "preset_edit2.png");
+
new_image_set("histogram_carrot",
5,
"histogram_carrot_up.png",