-HistogramSelect::HistogramSelect(HistogramMain *plugin, HistogramWindow *gui,
- int x, int y)
- : BC_GenericButton(x, y, xS(100), _("Frames"))
-{
- this->plugin = plugin;
- this->gui = gui;
- set_tooltip(_("Set frames to selection duration"));
-}
-int HistogramSelect::handle_event()
-{
- MWindow *mwindow = plugin->server->mwindow;
- if( mwindow ) {
- EDL *edl = mwindow->edl;
- double start = edl->local_session->get_selectionstart();
- int64_t start_pos = edl->get_frame_rate() * start;
- double end = edl->local_session->get_selectionend();
- int64_t end_pos = edl->get_frame_rate() * end;
- int64_t frames = end_pos - start_pos;
- gui->frames->update(frames);
- plugin->config.frames = frames;
- plugin->send_configure_change();
- }
- return 1;
-}
-
-HistogramClearFrames::HistogramClearFrames(HistogramMain *plugin, HistogramWindow *gui,
- int x, int y)
- : BC_Button(x, y, plugin->get_theme()->get_image_set("reset_button"))
-{
- this->plugin = plugin;
- this->gui = gui;
- set_tooltip(_("Clear frames"));
-}
-
-int HistogramClearFrames::handle_event()
-{
- plugin->config.frames = 0;
- gui->frames->update(0);
- plugin->send_configure_change();
- return 1;
-}
-