int CWindowGUI::button_press_event()
{
+ if( current_operation == CWINDOW_NONE &&
+ mwindow->edl != 0 && canvas->get_canvas() &&
+ canvas->get_canvas()->get_cursor_over_window() ) {
+ switch( get_buttonpress() ) {
+ case LEFT_BUTTON:
+ if( !cwindow->playback_engine->is_playing_back ) {
+ double length = mwindow->edl->tracks->total_playable_length();
+ double position = cwindow->playback_engine->get_tracking_position();
+ if( position >= length ) transport->goto_start();
+ }
+ return transport->forward_play->handle_event();
+ case MIDDLE_BUTTON:
+ if( !cwindow->playback_engine->is_playing_back ) {
+ double position = cwindow->playback_engine->get_tracking_position();
+ if( position <= 0 ) transport->goto_end();
+ }
+ return transport->reverse_play->handle_event();
+ case RIGHT_BUTTON: // activates popup
+ break;
+ case WHEEL_UP:
+ return transport->frame_forward_play->handle_event();
+ case WHEEL_DOWN:
+ return transport->frame_reverse_play->handle_event();
+ }
+ }
if(canvas->get_canvas())
return canvas->button_press_event_base(canvas->get_canvas());
return 0;
gui->y_offset = get_y_offset(mwindow->edl, 0, zoom_y, conformed_w, conformed_h);
// Scroll view
- if(get_buttonpress() == 2)
+ if( mwindow->edl->session->cwindow_operation != CWINDOW_PROTECT &&
+ get_buttonpress() == 2 )
{
gui->current_operation = CWINDOW_SCROLL;
result = 1;
{
this->mwindow = mwindow;
this->panel = panel;
- set_tooltip(_("In point ( [ )"));
+ set_tooltip(_("In point ( [ or < )"));
}
EditInPoint::~EditInPoint()
{
{
this->mwindow = mwindow;
this->panel = panel;
- set_tooltip(_("Out point ( ] )"));
+ set_tooltip(_("Out point ( ] or > )"));
}
EditOutPoint::~EditOutPoint()
{
#include "preferences.h"
#include "theme.h"
#include "transportque.h"
+#include "track.h"
+#include "tracks.h"
#include "videowindow.h"
#include "vplayback.h"
#include "vwindow.h"
sizeof(new_edl->session->achannel_positions));
new_edl->session->boundaries();
new_edl->create_default_tracks();
-
+ if( load_mode == LOADMODE_NEW_TRACKS ) {
+ Tracks *tracks = mwindow->edl->tracks;
+ int vindex = tracks->total_video_tracks();
+ int aindex = tracks->total_audio_tracks();
+ for( Track *track=new_edl->tracks->first; track; track=track->next ) {
+ switch( track->data_type ) {
+ case TRACK_AUDIO:
+ sprintf(track->title, _("Audio %d"), ++aindex);
+ break;
+ case TRACK_VIDEO:
+ sprintf(track->title, _("Video %d"), ++vindex);
+ break;
+ }
+ }
+ }
mwindow->undo->update_undo_before();
mwindow->set_filename("");
ArrayList<EDL *>new_edls;
{
delete_buffer();
delete trigger_lock;
+ delete pause_record_lock;
+ delete record_paused_lock;
}
void RecordAudio::reset_parameters()
RecordGUI::~RecordGUI()
{
delete status_thread;
+ delete record_transport;
delete batch_source;
delete batch_mode;
delete batch_flash;
input_lock->unlock();
}
Thread::join();
+ delete input_lock;
}
void RecordStatusThread::reset_video()
delete avc1394_transport;
delete avc1394transport_title;
#endif
+ delete meters;
unlock_window();
}
Track* Tracks::add_video_track(int above, Track *dst_track)
{
-const int debug = 0;
-if(debug) printf("Tracks::add_video_track %d\n", __LINE__);
VTrack* new_track = new VTrack(edl, this);
-if(debug) printf("Tracks::add_video_track %d\n", __LINE__);
if(!dst_track)
dst_track = (above ? first : last);
-
-if(debug) printf("Tracks::add_video_track %d\n", __LINE__);
if(above)
- {
insert_before(dst_track, (Track*)new_track);
- }
else
- {
insert_after(dst_track, (Track*)new_track);
- }
-if(debug) printf("Tracks::add_video_track %d\n", __LINE__);
-
-
-// Shift effects referenced below the new track
- for(Track *track = last;
- track && track != new_track;
- track = track->previous)
- {
+ for(Track *track = last; track && track != new_track; track = track->previous)
change_modules(number_of(track) - 1, number_of(track), 0);
- }
-
-if(debug) printf("Tracks::add_video_track %d\n", __LINE__);
-
new_track->create_objects();
-if(debug) printf("Tracks::add_video_track %d\n", __LINE__);
new_track->set_default_title();
-if(debug) printf("Tracks::add_video_track %d\n", __LINE__);
return new_track;
}
Track* Tracks::add_subttl_track(int above, Track *dst_track)
{
-const int debug = 0;
-if(debug) printf("Tracks::add_subttl_track %d\n", __LINE__);
STrack* new_track = new STrack(edl, this);
-if(debug) printf("Tracks::add_subttl_track %d\n", __LINE__);
if(!dst_track)
dst_track = (above ? first : last);
-if(debug) printf("Tracks::add_subttl_track %d\n", __LINE__);
if(above)
- {
insert_before(dst_track, (Track*)new_track);
- }
else
- {
insert_after(dst_track, (Track*)new_track);
- }
-if(debug) printf("Tracks::add_subttl_track %d\n", __LINE__);
-
-
-// Shift effects referenced below the new track
- for(Track *track = last;
- track && track != new_track;
- track = track->previous)
- {
+ for(Track *track = last; track && track != new_track; track = track->previous)
change_modules(number_of(track) - 1, number_of(track), 0);
- }
-
-if(debug) printf("Tracks::add_subttl_track %d\n", __LINE__);
-
new_track->create_objects();
-if(debug) printf("Tracks::add_subttl_track %d\n", __LINE__);
new_track->set_default_title();
-if(debug) printf("Tracks::add_subttl_track %d\n", __LINE__);
-
// new_track->paste_silence(0,total_length(),0);
return new_track;
}
update(1);
}
+double VTimeBar::test_highlight()
+{
+ return gui->edit_panel->get_position();
+}
double pixel_to_position(int pixel);
void update_cursor();
int has_preview() { return 1; }
+ double test_highlight();
VWindowGUI *gui;
};
break;
}
if(!result) result = transport->keypress_event();
-
+ if( result && !vwindow->playback_engine->is_playing_back )
+ timebar->update(1);
return result;
}
int VWindowGUI::button_press_event()
{
- if( get_buttonpress() == LEFT_BUTTON && canvas->get_canvas() &&
+ if( vwindow->get_edl() != 0 && canvas->get_canvas() &&
canvas->get_canvas()->get_cursor_over_window() ) {
- PlaybackEngine *playback_engine = vwindow->playback_engine;
- if( !playback_engine->is_playing_back && vwindow->get_edl() != 0 ) {
- double length = vwindow->get_edl()->tracks->total_playable_length();
- double position = playback_engine->get_tracking_position();
- if( position >= length ) transport->goto_start();
+ switch( get_buttonpress() ) {
+ case LEFT_BUTTON:
+ if( !vwindow->playback_engine->is_playing_back ) {
+ double length = vwindow->get_edl()->tracks->total_playable_length();
+ double position = vwindow->playback_engine->get_tracking_position();
+ if( position >= length ) transport->goto_start();
+ }
+ return transport->forward_play->handle_event();
+ case MIDDLE_BUTTON:
+ if( !vwindow->playback_engine->is_playing_back ) {
+ double position = vwindow->playback_engine->get_tracking_position();
+ if( position <= 0 ) transport->goto_end();
+ }
+ return transport->reverse_play->handle_event();
+ case RIGHT_BUTTON: // activates popup
+ break;
+ case WHEEL_UP:
+ return transport->frame_forward_play->handle_event();
+ case WHEEL_DOWN:
+ return transport->frame_reverse_play->handle_event();
}
- return transport->forward_play->handle_event();
}
if(canvas->get_canvas())
return canvas->button_press_event_base(canvas->get_canvas());
list_highlighted = 0;
disabled = 0;
+ scroll_repeat = 0;
allow_drag_scroll = 1;
process_drag = 1;
{
this->is_suggestions = value;
}
+void BC_ListBox::set_scroll_repeat()
+{
+ if( scroll_repeat ) return;
+ scroll_repeat = 1;
+ set_repeat(get_resources()->scroll_repeat);
+}
+
+void BC_ListBox::unset_scroll_repeat()
+{
+ if( !scroll_repeat ) return;
+ scroll_repeat = 0;
+ unset_repeat(get_resources()->scroll_repeat);
+}
void BC_ListBox::set_use_button(int value)
{
int cursor_x, cursor_y;
int do_event = 0;
new_value = 0;
+ unset_scroll_repeat();
//printf("BC_ListBox::button_release_event 1 %d\n", current_operation);
switch( current_operation ) {
case BUTTON_DOWN_SELECT:
case SELECT:
//printf("BC_ListBox::button_release_event 10\n");
- unset_repeat(get_resources()->scroll_repeat);
current_operation = NO_OPERATION;
if( gui ) {
translate_coordinates(top_level->event_win, gui->win,
case SELECT_RECT:
- unset_repeat(get_resources()->scroll_repeat);
if( data ) {
// Demote selections from rectangle selection
promote_selections(data, 2, 1);
break; }
case SELECT_RECT: {
- if( test_drag_scroll(get_cursor_x(), get_cursor_y()) ) {
- set_repeat(get_resources()->scroll_repeat);
- }
+ if( test_drag_scroll(get_cursor_x(), get_cursor_y()) )
+ set_scroll_repeat();
int old_x1 = MIN(rect_x1, rect_x2);
int old_x2 = MAX(rect_x1, rect_x2);
case SELECT: {
int old_highlighted_item = highlighted_item;
- if( test_drag_scroll(get_cursor_x(),
- get_cursor_y()) ) {
- set_repeat(get_resources()->scroll_repeat);
- }
-
+ if( test_drag_scroll(get_cursor_x(), get_cursor_y()) )
+ set_scroll_repeat();
highlighted_item = selection_number = get_cursor_item(data,
get_cursor_x(), get_cursor_y(), &highlighted_ptr);
current_operation = DRAG_ITEM;
// require shift down for scrolling
if( allow_drag < 0 && shift_down() )
- set_repeat(get_resources()->scroll_repeat);
+ set_scroll_repeat();
return 1;
}
}
int BC_ListBox::drag_stop_event()
{
int result = 0;
+ unset_scroll_repeat();
switch( current_operation ) {
case DRAG_ITEM:
- unset_repeat(get_resources()->scroll_repeat);
// Inside window boundary
if( top_level->cursor_x > 0 &&
top_level->cursor_x < gui->get_w() - drag_popup->get_w() / 2 &&
// Must be called in the constructor.
void set_use_button(int value);
void set_is_suggestions(int value);
-
+ void set_scroll_repeat();
+ void unset_scroll_repeat();
+ int scroll_repeat;
// change the contents
int update(ArrayList<BC_ListBoxItem*> *data,