int AssetPopupMixer::handle_event()
{
+ ArrayList<ZWindow *>new_mixers;
+
mwindow->select_zwindow(0);
for( int i=0; i<mwindow->session->drag_assets->total; ++i ) {
Indexable *indexable = mwindow->session->drag_assets->values[i];
char *tp = strrchr(path, '/');
if( !tp ) tp = path; else ++tp;
zwindow->set_title(tp);
- zwindow->start();
+ new_mixers.append(zwindow);
}
- mwindow->queue_mixers(mwindow->edl,CURRENT_FRAME,0,0,1,0);
+
+ mwindow->tile_mixers();
+ for( int i=0; i<new_mixers.size(); ++i )
+ new_mixers[i]->start();
+
+ mwindow->refresh_mixers();
mwindow->resync_guis();
return 1;
}
if(position)
{
- mwindow->queue_mixers(mwindow->edl, CURRENT_FRAME,1,0,1,0);
- playback_engine->que->send_command(CURRENT_FRAME,
- CHANGE_NONE,
- mwindow->edl,
- 1);
+ refresh_frame(CHANGE_NONE);
}
gui->lock_window("CWindow::update 2");
return 1;
}
+void CWindow::refresh_frame(int change_type, EDL *edl)
+{
+ mwindow->refresh_mixers();
+ playback_engine->refresh_frame(change_type, edl);
+}
-
+void CWindow::refresh_frame(int change_type)
+{
+ refresh_frame(change_type, mwindow->edl);
+}
CWindowRemoteHandler::
CWindowRemoteHandler(RemoteControl *remote_control)
#include "cplayback.inc"
#include "ctracking.inc"
#include "cwindowgui.inc"
+#include "edl.inc"
#include "floatauto.inc"
#include "mwindow.inc"
#include "remotecontrol.h"
void hide_window();
int update_position(double position);
void stop_playback(int wait);
+ void refresh_frame(int change_type);
+ void refresh_frame(int change_type, EDL *edl);
int destination;
MWindow *mwindow;
gui->unlock_window();
mwindow->restart_brender();
mwindow->sync_parameters(CHANGE_PARAMS);
- gui->cwindow->playback_engine->que->send_command(CURRENT_FRAME,
- CHANGE_NONE,
- mwindow->edl,
- 1);
+ mwindow->cwindow->refresh_frame(CHANGE_NONE);
if(!redraw) gui->update_tool();
gui->lock_window("CWindowCanvas::cursor_motion_event 2");
}
mwindow->restart_brender();
mwindow->sync_parameters(CHANGE_PARAMS);
- gui->cwindow->playback_engine->que->send_command(CURRENT_FRAME,
- CHANGE_NONE,
- mwindow->edl,
- 1);
+ mwindow->cwindow->refresh_frame(CHANGE_NONE);
if(!redraw) gui->update_tool();
gui->lock_window("CWindowCanvas::button_press_event 2");
}
mwindow->gui->draw_overlays(1);
mwindow->sync_parameters(CHANGE_PARAMS);
mwindow->gui->unlock_window();
- mwindow->cwindow->playback_engine->que->send_command(CURRENT_FRAME,
- CHANGE_NONE, mwindow->edl, 1);
+ mwindow->cwindow->refresh_frame(CHANGE_NONE);
mwindow->cwindow->gui->lock_window("CWindowCameraGUI::update_preview");
mwindow->cwindow->gui->canvas->draw_refresh();
mwindow->cwindow->gui->unlock_window();
mwindow->sync_parameters(CHANGE_PARAMS);
mwindow->gui->draw_overlays(1);
mwindow->gui->unlock_window();
- mwindow->cwindow->playback_engine->que->send_command(CURRENT_FRAME,
- CHANGE_NONE, mwindow->edl, 1);
+ mwindow->cwindow->refresh_frame(CHANGE_NONE);
mwindow->cwindow->gui->lock_window("CWindowProjectorGUI::update_preview");
mwindow->cwindow->gui->canvas->draw_refresh();
mwindow->cwindow->gui->unlock_window();
mwindow->sync_parameters(CHANGE_PARAMS);
mwindow->gui->draw_overlays(1);
mwindow->gui->unlock_window();
- mwindow->cwindow->playback_engine->que->send_command(CURRENT_FRAME,
- CHANGE_NONE, mwindow->edl, 1);
+ mwindow->cwindow->refresh_frame(CHANGE_NONE);
mwindow->cwindow->gui->lock_window("CWindowMaskGUI::update_preview");
mwindow->cwindow->gui->canvas->draw_refresh();
mwindow->cwindow->gui->unlock_window();
int FFAudioStream::encode_activate()
{
if( writing >= 0 ) return writing;
+ if( !avctx->codec ) return writing = 0;
frame_sz = avctx->codec->capabilities & CODEC_CAP_VARIABLE_FRAME_SIZE ?
10000 : avctx->frame_size;
return FFStream::encode_activate();
windowmenu->add_item(split_x = new SplitX(mwindow));
windowmenu->add_item(split_y = new SplitY(mwindow));
windowmenu->add_item(mixer_viewer = new MixerViewer(mwindow));
+ windowmenu->add_item(new TileMixers(mwindow));
windowmenu->add_item(new TileWindows(mwindow,_("Default positions"),-1,_("Ctrl-P"),'p'));
windowmenu->add_item(new TileWindows(mwindow,_("Tile left"),0));
windowmenu->add_item(new TileWindows(mwindow,_("Tile right"),1));
return 1;
}
+TileMixers::TileMixers(MWindow *mwindow)
+ : BC_MenuItem(_("Tile mixers"), "Alt-t", 't')
+{
+ this->mwindow = mwindow;
+ set_alt();
+}
+
+int TileMixers::handle_event()
+{
+ mwindow->tile_mixers();
+ return 1;
+}
+
MWindow *mwindow;
};
+class TileMixers : public BC_MenuItem
+{
+public:
+ TileMixers(MWindow *mwindow);
+ int handle_event();
+ MWindow *mwindow;
+};
+
// ======================================== audio
class AddAudioTrack : public BC_MenuItem
delete render; render = 0;
commit_commercial();
if( commercials && !commercials->remove_user() ) commercials = 0;
+ close_mixers();
// Save defaults for open plugins
plugin_gui_lock->lock("MWindow::~MWindow");
if( !mixer ) mixer = edl->mixers.new_mixer();
ZWindow *zwindow = 0;
for( int i=0; !zwindow && i<zwindows.size(); ++i )
- if( !zwindows[i]->is_running() ) zwindow = zwindows[i];
+ if( zwindows[i]->idx < 0 ) zwindow = zwindows[i];
if( !zwindow )
zwindows.append(zwindow = new ZWindow(this));
zwindow->idx = mixer->idx;
zwindow->set_title(title);
zwindow->start();
- queue_mixers(edl,CURRENT_FRAME,0,0,1,0);
+ refresh_mixers();
}
int MWindow::mixer_track_active(Track *track)
zwindows_lock->lock("MWindow::queue_mixers");
for( int vidx=0; vidx<zwindows.size(); ++vidx ) {
ZWindow *zwindow = zwindows[vidx];
- if( !zwindow->running() ) continue;
+ if( zwindow->idx < 0 ) continue;
Mixer *mixer = edl->mixers.get_mixer(zwindow->idx);
if( !mixer || !mixer->mixer_ids.size() ) continue;
int k = -1;
zwindows_lock->unlock();
}
+void MWindow::refresh_mixers()
+{
+ queue_mixers(edl,CURRENT_FRAME,0,0,1,0);
+}
+
void MWindow::stop_mixers()
{
for( int vidx=0; vidx<zwindows.size(); ++vidx ) {
ZWindow *zwindow = zwindows[vidx];
- if( !zwindow->running() ) continue;
+ if( zwindow->idx < 0 ) continue;
zwindow->issue_command(STOP, 0, 0, 0, 0);
}
}
+void MWindow::close_mixers()
+{
+ zwindows_lock->lock("MWindow::close_mixers");
+ for( int i=0; i<zwindows.size(); ++i ) {
+ ZWindow *zwindow = zwindows[i];
+ if( zwindow->idx < 0 ) continue;
+ ZWindowGUI *zgui = zwindow->zgui;
+ zgui->lock_window("MWindow::select_zwindow 0");
+ zgui->set_done(0);
+ zgui->unlock_window();
+ }
+ zwindows_lock->unlock();
+ for( int i=0; i<zwindows.size(); ++i ) {
+ ZWindow *zwindow = zwindows[i];
+ if( zwindow->idx < 0 ) continue;
+ zwindow->close_window();
+ }
+}
+
int MWindow::select_zwindow(ZWindow *zwindow)
{
int ret = 0, n = zwindows.number_of(zwindow);
session->selected_zwindow = n;
for( int i=0; i<zwindows.size(); ++i ) {
ZWindow *zwindow = zwindows[i];
- if( !zwindow->running() ) continue;
+ if( zwindow->idx < 0 ) continue;
ZWindowGUI *zgui = zwindow->zgui;
zgui->lock_window("MWindow::select_zwindow 0");
zwindow->highlighted = i == n ? 1 : 0;
return ret;
}
+void MWindow::tile_mixers()
+{
+ int nz = 0;
+ for( int i=0; i<zwindows.size(); ++i ) {
+ ZWindow *zwindow = zwindows[i];
+ if( zwindow->idx < 0 ) continue;
+ ++nz;
+ }
+ if( !nz ) return;
+ int zn = ceil(sqrt(nz));
+ int x1 = 1 + gui->get_x(), x2 = cwindow->gui->get_x();
+ int y1 = 1, y2 = gui->get_y();
+ int rw = gui->get_root_w(0), rh = gui->get_root_h(0);
+ if( x1 < 0 ) x1 = 0;
+ if( y1 < 0 ) y1 = 0;
+ if( x2 > rw ) x2 = rw;
+ if( y2 > rh ) y2 = rh;
+ int dx = x2 - x1, dy = y2 - y1;
+ int zw = dx / zn;
+ int lt = BC_DisplayInfo::get_left_border();
+ int top = BC_DisplayInfo::get_top_border();
+ int bw = lt + BC_DisplayInfo::get_right_border(); // borders
+ int bh = top + BC_DisplayInfo::get_bottom_border();
+ int zx = 0, zy = 0; // window origins
+ int mw = 10+10, mh = 10+10; // canvas margins
+ int rsz = 0, n = 0, dz = 0;
+ int ow = edl->session->output_w, oh = edl->session->output_h;
+ for( int i=0; i<zwindows.size(); ++i ) {
+ ZWindow *zwindow = zwindows[i];
+ if( zwindow->idx < 0 ) continue;
+ int ww = zw - bw, hh = (ww - mw) * oh / ow + mh, zh = hh + bh;
+ if( rsz < hh ) rsz = hh;
+ int xx = zx + x1, yy = zy + y1;
+ int mx = x2 - zw, my = y2 - zh;
+ if( xx > mx ) xx = mx;
+ if( yy > my ) yy = my;
+ xx += lt + dz; yy += top + dz;
+ zwindow->reposition(xx,yy, ww,hh);
+ if( zwindow->running() ) {
+ ZWindowGUI *gui = (ZWindowGUI *)zwindow->get_gui();
+ gui->lock_window("MWindow::tile_mixers");
+ gui->BC_WindowBase::reposition_window(xx,yy, ww,hh);
+ gui->unlock_window();
+ }
+ if( ++n >= zn ) {
+ n = 0; rsz += bh;
+ if( (zy += rsz) > (dy - rsz) ) dz += 10;
+ rsz = 0;
+ zx = 0;
+ }
+ else
+ zx += zw;
+ }
+}
+
void MWindow::init_cache()
{
}
for(int i = 0; i < zwindows.size(); i++) {
ZWindow *zwindow = zwindows[i];
- if( !zwindow->is_running() ) continue;
+ if( zwindow->idx < 0 ) continue;
zwindow->stop_playback(wait);
}
}
}
else
{
- queue_mixers(edl,CURRENT_FRAME,0,0,1,0);
- cwindow->playback_engine->que->send_command(CURRENT_FRAME,
- change_type,
- edl,
- 1);
+ cwindow->refresh_frame(change_type);
}
}
}
if(debug) PRINT_TRACE
select_zwindow(0);
- for( int i=0; i<zwindows.size(); ++i ) {
- ZWindow *zwindow = zwindows[i];
- if( !zwindow->is_running() ) continue;
- zwindow->close_window();
- }
+ close_mixers();
for( int i=0; i<edl->mixers.size(); ++i ) {
Mixer *mixer = edl->mixers[i];
cwindow->gui->unlock_window();
if(debug) PRINT_TRACE
- cwindow->playback_engine->que->send_command(CURRENT_FRAME,
- CHANGE_ALL,
- edl,
- 1);
+ cwindow->refresh_frame(CHANGE_ALL);
awindow->gui->async_update_assets();
if(debug) PRINT_TRACE
void queue_mixers(EDL *edl, int command, int wait_tracking,
int use_inout, int update_refresh, int toggle_audio);
+ void refresh_mixers();
void stop_mixers();
+ void close_mixers();
ZWindow *get_mixer(Mixer *&mixer);
void del_mixer(ZWindow *zwindow);
int mixer_track_active(Track *track);
void update_mixer_tracks();
void start_mixer();
int select_zwindow(ZWindow *zwindow);
+ void tile_mixers();
int load_filenames(ArrayList<char*> *filenames,
int load_mode = LOADMODE_REPLACE,
// gui->cursor->draw(1);
// gui->canvas->flash();
// gui->canvas->activate();
- cwindow->playback_engine->que->
- send_command(CURRENT_FRAME, CHANGE_EDL, edl, 1);
+ cwindow->refresh_frame(CHANGE_EDL);
}
void MWindow::add_video_track_entry(Track *dst)
// gui->cursor->draw(1);
// gui->canvas->flash();
// gui->canvas->activate();
- cwindow->playback_engine->que->
- send_command(CURRENT_FRAME, CHANGE_EDL, edl, 1);
+ cwindow->refresh_frame(CHANGE_EDL);
save_backup();
}
// gui->cursor->draw(1);
// gui->canvas->flash();
// gui->canvas->activate();
- cwindow->playback_engine->que->
- send_command(CURRENT_FRAME, CHANGE_EDL, edl, 1);
+ cwindow->refresh_frame(CHANGE_EDL);
save_backup();
}
update_plugin_guis();
gui->update(1, 2, 1, 1, 1, 1, 0);
cwindow->update(1, 0, 0, 0, 1);
- cwindow->playback_engine->que->
- send_command(CURRENT_FRAME, CHANGE_EDL, edl, 1);
+ cwindow->refresh_frame(CHANGE_EDL);
}
void MWindow::clear(int clear_handle)
restart_brender();
gui->update(1, 1, 0, 0, 1, 0, 0);
- cwindow->playback_engine->que->
- send_command(CURRENT_FRAME, CHANGE_EDL, edl, 1);
+ cwindow->refresh_frame(CHANGE_EDL);
}
undo->update_undo_after(_("crop"), LOAD_ALL);
restart_brender();
- cwindow->playback_engine->que->
- send_command(CURRENT_FRAME, CHANGE_ALL, edl, 1);
+ cwindow->refresh_frame(CHANGE_ALL);
save_backup();
}
gui->update(1, 2, 1, 1, 1, 1, 0);
cwindow->update(1, 0, 0, 0, 1);
awindow->gui->async_update_assets();
- cwindow->playback_engine->que->
- send_command(CURRENT_FRAME, CHANGE_EDL, edl, 1);
+ cwindow->refresh_frame(CHANGE_EDL);
}
void MWindow::cut(double start, double end, double new_position)
gui->update(1, 2, 1, 1, 1, 1, 0);
cwindow->update(1, 0, 0, 0, 1);
awindow->gui->async_update_assets();
- cwindow->playback_engine->que->
- send_command(CURRENT_FRAME, CHANGE_EDL, edl, 1);
+ cwindow->refresh_frame(CHANGE_EDL);
}
void MWindow::snap_left_edit()
update_plugin_states();
gui->update(1, 1, 1, 0, 1, 0, 0);
- cwindow->playback_engine->que->
- send_command(CURRENT_FRAME, CHANGE_EDL, edl, 1);
+ cwindow->refresh_frame(CHANGE_EDL);
}
void MWindow::delete_track(Track *track)
update_plugin_states();
gui->update(1, 1, 1, 0, 1, 0, 0);
- cwindow->playback_engine->que->
- send_command(CURRENT_FRAME, CHANGE_EDL, edl, 1);
+ cwindow->refresh_frame(CHANGE_EDL);
save_backup();
}
undo->update_undo_after(_("move edit"), LOAD_ALL);
restart_brender();
- cwindow->playback_engine->que->
- send_command(CURRENT_FRAME, CHANGE_EDL, edl, 1);
+ cwindow->refresh_frame(CHANGE_EDL);
update_plugin_guis();
gui->update(1, 1, // 1 for incremental drawing. 2 for full refresh
undo->update_undo_after(_("paste effect"), LOAD_ALL);
restart_brender();
- cwindow->playback_engine->que->
- send_command(CURRENT_FRAME, CHANGE_EDL, edl, 1);
+ cwindow->refresh_frame(CHANGE_EDL);
update_plugin_guis();
gui->update(1, 1, // 1 for incremental drawing. 2 for full refresh
0, 0, 0, 0, 0);
undo->update_undo_after(_("move effect"), LOAD_ALL);
restart_brender();
- cwindow->playback_engine->que->
- send_command(CURRENT_FRAME, CHANGE_EDL, edl, 1);
+ cwindow->refresh_frame(CHANGE_EDL);
update_plugin_guis();
gui->update(1, 1, // 1 for incremental drawing. 2 for full refresh
0, 0, 0, 0, 0);
restart_brender();
update_plugin_guis();
gui->update(1, 2, 1, 1, 1, 1, 0);
- cwindow->playback_engine->que->
- send_command(CURRENT_FRAME, CHANGE_EDL, edl, 1);
+ cwindow->refresh_frame(CHANGE_EDL);
}
}
restart_brender();
gui->update(1, 2, 1, 1, 1, 1, 0);
cwindow->update(1, 0, 0, 0, 1);
- cwindow->playback_engine->que->
- send_command(CURRENT_FRAME, CHANGE_EDL, edl, 1);
+ cwindow->refresh_frame(CHANGE_EDL);
}
void MWindow::detach_transition(Transition *transition)
}
}
- cwindow->playback_engine->que->
- send_command(CURRENT_FRAME, CHANGE_ALL, edl, 1);
+ cwindow->refresh_frame(CHANGE_ALL);
}
cwindow->update(1, 0, 0, 0, 1);
awindow->gui->async_update_assets();
restart_brender();
- cwindow->playback_engine->que->
- send_command(CURRENT_FRAME, CHANGE_EDL, edl, 1);
+ cwindow->refresh_frame(CHANGE_EDL);
}
awindow->gui->async_update_assets();
- cwindow->playback_engine->que->
- send_command(CURRENT_FRAME, CHANGE_ALL, edl, 1);
+ cwindow->refresh_frame(CHANGE_ALL);
calling_window_gui->lock_window("MWindow::undo_entry 4");
}
update_plugin_guis();
gui->update(1, 2, 1, 1, 1, 1, 0);
cwindow->update(1, 0, 0, 0, 1);
- cwindow->playback_engine->que->
- send_command(CURRENT_FRAME, CHANGE_EDL, edl, 1);
+ cwindow->refresh_frame(CHANGE_EDL);
}
switch (i)
{
case AUTOGROUPTYPE_AUDIO_FADE:
+ if (range < 1) {
+ min = MIN(min, edl->local_session->automation_mins[i]);
+ max = MAX(max, edl->local_session->automation_maxs[i]);
+ if( min >= max-0.1 ) { min = -80.0; min = 6.0; }
+ }
+ break;
case AUTOGROUPTYPE_VIDEO_FADE:
- if (range < 0.1) {
+ if (range < 1) {
min = MIN(min, edl->local_session->automation_mins[i]);
max = MAX(max, edl->local_session->automation_maxs[i]);
+ if( min >= max-0.1 ) { min = 0.0; min = 100.0; }
}
break;
case AUTOGROUPTYPE_ZOOM:
break;
case AUTOGROUPTYPE_X:
case AUTOGROUPTYPE_Y:
- if (range < 5) {
- min = floor((min+max)/2) - 50;
- max = floor((min+max)/2) + 50;
+ if (range < 1) {
+ float scale = bmin(edl->session->output_w, edl->session->output_h);
+ min = floor((min+max)/2) - 0.5*scale;
+ max = floor((min+max)/2) + 0.5*scale;
}
break;
}
FrameSizePulldown::FrameSizePulldown(Theme *theme,
BC_TextBox *output_w, BC_TextBox *output_h, int x, int y)
- : BC_ListBox(x, y, 150, 250, LISTBOX_TEXT,
+ : BC_ListBox(x, y, 180, 250, LISTBOX_TEXT,
&theme->frame_sizes, 0, 0, 1, 0, 1)
{
this->theme = theme;
}
}
+void PlaybackEngine::refresh_frame(int change_type, EDL *edl)
+{
+ que->send_command(CURRENT_FRAME, change_type, edl, 1);
+}
+
void stop_playback(int wait);
void issue_command(EDL *edl, int command, int wait_tracking,
int use_inout, int update_refresh, int toggle_audio);
+ void refresh_frame(int change_type, EDL *edl);
// Maintain caches through console changes
CICache *audio_cache, *video_cache;
//printf("PreferencesThread::apply_settings 1\n");
// This doesn't stop and restart, only reloads the assets before
// the next play command.
- mwindow->cwindow->playback_engine->que->send_command(CURRENT_FRAME,
- CHANGE_ALL,
- mwindow->edl,
- 1);
+ mwindow->cwindow->refresh_frame(CHANGE_ALL, mwindow->edl);
//printf("PreferencesThread::apply_settings 10\n");
}
aspect_ratios.append(new BC_ListBoxItem("2.35:1"));
aspect_ratios.append(new BC_ListBoxItem("2.66:1"));
- frame_sizes.append(new BC_ListBoxItem("128x96"));
- frame_sizes.append(new BC_ListBoxItem("160x120"));
- frame_sizes.append(new BC_ListBoxItem("320x240"));
- frame_sizes.append(new BC_ListBoxItem("360x240"));
- frame_sizes.append(new BC_ListBoxItem("400x300"));
- frame_sizes.append(new BC_ListBoxItem("640x400"));
- frame_sizes.append(new BC_ListBoxItem("640x480"));
- frame_sizes.append(new BC_ListBoxItem("720x480"));
- frame_sizes.append(new BC_ListBoxItem("800x600"));
- frame_sizes.append(new BC_ListBoxItem("1024x768"));
- frame_sizes.append(new BC_ListBoxItem("1280x720"));
- frame_sizes.append(new BC_ListBoxItem("1280x1024"));
- frame_sizes.append(new BC_ListBoxItem("1600x1200"));
- frame_sizes.append(new BC_ListBoxItem("1920x1080"));
- frame_sizes.append(new BC_ListBoxItem("3840x2160"));
- frame_sizes.append(new BC_ListBoxItem("4096x1720"));
+ frame_sizes.append(new BC_ListBoxItem("128x96 "));
+ frame_sizes.append(new BC_ListBoxItem("160x120 "));
+ frame_sizes.append(new BC_ListBoxItem("320x240 "));
+ frame_sizes.append(new BC_ListBoxItem("360x240 "));
+ frame_sizes.append(new BC_ListBoxItem("400x300 "));
+ frame_sizes.append(new BC_ListBoxItem("640x360 nHD"));
+ frame_sizes.append(new BC_ListBoxItem("640x400 "));
+ frame_sizes.append(new BC_ListBoxItem("640x480 VGA"));
+ frame_sizes.append(new BC_ListBoxItem("720x480 NTSC"));
+ frame_sizes.append(new BC_ListBoxItem("720x576 PAL"));
+ frame_sizes.append(new BC_ListBoxItem("768x432 "));
+ frame_sizes.append(new BC_ListBoxItem("800x450 "));
+ frame_sizes.append(new BC_ListBoxItem("800x600 SVGA"));
+ frame_sizes.append(new BC_ListBoxItem("896x504 "));
+ frame_sizes.append(new BC_ListBoxItem("960x540 qHD"));
+ frame_sizes.append(new BC_ListBoxItem("1024x576 "));
+ frame_sizes.append(new BC_ListBoxItem("1024x768 XGA"));
+ frame_sizes.append(new BC_ListBoxItem("1152x648 "));
+ frame_sizes.append(new BC_ListBoxItem("1280x720 HD"));
+ frame_sizes.append(new BC_ListBoxItem("1280x1024 SXGA"));
+ frame_sizes.append(new BC_ListBoxItem("1366x768 WXGA"));
+ frame_sizes.append(new BC_ListBoxItem("1600x900 HD+"));
+ frame_sizes.append(new BC_ListBoxItem("1600x1200 UXGA"));
+ frame_sizes.append(new BC_ListBoxItem("1920x1080 Full HD"));
+ frame_sizes.append(new BC_ListBoxItem("2048x1152 "));
+ frame_sizes.append(new BC_ListBoxItem("2304x1296 "));
+ frame_sizes.append(new BC_ListBoxItem("2560x1440 QHD"));
+ frame_sizes.append(new BC_ListBoxItem("2880x1620 "));
+ frame_sizes.append(new BC_ListBoxItem("3200x1800 QHD+"));
+ frame_sizes.append(new BC_ListBoxItem("3520x1980 "));
+ frame_sizes.append(new BC_ListBoxItem("3840x2160 4K UHD"));
+ frame_sizes.append(new BC_ListBoxItem("4096x2304 Full 4K UHD"));
+ frame_sizes.append(new BC_ListBoxItem("4480x2520 "));
+ frame_sizes.append(new BC_ListBoxItem("5120x2880 5K UHD"));
+ frame_sizes.append(new BC_ListBoxItem("5760x3240 "));
+ frame_sizes.append(new BC_ListBoxItem("6400x3600 "));
+ frame_sizes.append(new BC_ListBoxItem("7040x3960 "));
+ frame_sizes.append(new BC_ListBoxItem("7680x4320 8K UHD"));
sample_rates.append(new BC_ListBoxItem("8000"));
sample_rates.append(new BC_ListBoxItem("16000"));
{
//printf("VWindow::update_position %d\n", __LINE__);
//edl->dump();
- playback_engine->que->send_command(CURRENT_FRAME,
- change_type,
- edl,
- 1);
+ playback_engine->refresh_frame(change_type, edl);
double position = edl->local_session->get_selectionstart(1);
if(lock_window) gui->lock_window("VWindow::update_position");
void ZWindow::handle_done_event(int result)
{
+ mwindow->del_mixer(this);
}
void ZWindow::handle_close_event(int result)
{
this->edl->remove_user();
this->edl = edl;
if( edl != 0 ) {
- zgui->playback_engine->que->send_command(CURRENT_FRAME, CHANGE_ALL, edl, 1);
+ zgui->playback_engine->refresh_frame(CHANGE_ALL, edl);
}
}
void ZWindow::set_title(const char *tp)
{
+ Mixer *mixer = mwindow->edl->mixers.get_mixer(idx);
+ if( mixer ) mixer->set_title(tp);
char *cp = title, *ep = cp + sizeof(title)-1;
cp += snprintf(title, ep-cp, _("Mixer %d"), idx);
if( tp ) cp += snprintf(cp, ep-cp, ": %s", tp);
- else tp = title;
- Mixer *mixer = mwindow->edl->mixers.get_mixer(idx);
- if( mixer ) mixer->set_title(title);
+ *cp = 0;
}
void ZWindow::reposition(int x, int y, int w, int h)
{
Mixer *mixer = mwindow->edl->mixers.get_mixer(idx);
- if( mixer ) mixer->reposition(x, y, w, h);
+ if( !mixer ) return;
+ mixer->reposition(x, y, w, h);
}
#include "zwindowgui.h"
ZWindowGUI::ZWindowGUI(MWindow *mwindow, ZWindow *zwindow, Mixer *mixer)
- : BC_Window(mixer->title, mixer->x, mixer->y, mixer->w, mixer->h,
- 100, 100, 1, 1, 0)
+ : BC_Window(zwindow->title, mixer->x, mixer->y, mixer->w, mixer->h,
+ 100, 75, 1, 1, 0)
{
this->mwindow = mwindow;
this->zwindow = zwindow;
BC_WindowBase::resize_event(w, h);
return 1;
}
-
int ZWindowGUI::translation_event()
{
- zwindow->reposition(get_x(), get_y(), get_w(), get_h());
- return 0;
+ return resize_event(get_w(),get_h());
}
int ZWindowGUI::close_event()
{
- mwindow->del_mixer(zwindow);
set_done(0);
return 1;
}
CHECK_HEADERS([fdk], [fdk headers], [fdk-aac/genericStds.h])
CHECK_LIB([jbig], [jbig], [jbg_dec_init])
CHECK_LIB([vdpau], [vdpau], [vdp_device_create_x11])
+CHECK_LIB([opus], [opus], [opus_multistream_decoder_create])
+CHECK_HEADERS([opus], [libopus headers], [opus/opus_multistream.h])
#if test "x$HAVE_mjpegtools" = "xyes"; then
#CFG_CFLAGS+=" -I/usr/include/mjpegtools"
EXTRA_LIBS+=' -ldl'
FFMPEG_EXTRA_CFG+=' --extra-ldflags="-ldl"'
fi
+if test "x$HAVE_opus" = "xyes"; then
+ EXTRA_LIBS+=' -lopus'
+ CFG_CFLAGS+=' -I/usr/include/opus'
+ FFMPEG_EXTRA_CFG+=' --enable-libopus'
+fi
+
AC_SUBST(EXTRA_LIBS)
AC_SUBST(FFMPEG_EXTRA_CFG)
AC_SUBST(WANT_X264_HIDEPTH)
if test "x$WANT_GIT_FFMPEG" != "xno"; then
echo "ffmpeg.git := $WANT_GIT_FFMPEG"
fi
+if test "x$HAVE_opus" = "xyes"; then
+echo 'ffmpeg.cflags+=" -I/usr/include/opus"'
+fi
{
reset_parameters(1);
params = new BC_Hash;
+ use_shm = frame.use_shm;
allocate_data(0, -1, 0, 0, 0, frame.w, frame.h,
frame.color_model, frame.bytes_per_line);
copy_from(&frame);
this->data = 0;
int size = calculate_data_size(this->w, this->h,
this->bytes_per_line, this->color_model);
- if(BC_WindowBase::get_resources()->use_vframe_shm() && use_shm) {
+ if( use_shm && size >= SHM_MIN_SIZE &&
+ BC_WindowBase::get_resources()->use_vframe_shm() ) {
this->shmid = shmget(IPC_PRIVATE, size, IPC_CREAT | 0777);
if( this->shmid >= 0 ) {
this->data = (unsigned char*)shmat(this->shmid, NULL, 0);
}
}
// Have to use malloc for libpng
- if( !data ) {
+ if( !this->data ) {
this->data = (unsigned char *)malloc(size);
this->shmid = -1;
}
// Maximum number of prev or next effects to be pushed onto the stacks.
#define MAX_STACK_ELEMENTS 255
-
+#define SHM_MIN_SIZE 2048
// Scene graph for 3D models
// Defined by the subclass
+ChromaKeyConfig::ChromaKeyConfig()
+{
+ reset();
+}
+void ChromaKeyConfig::reset()
-ChromaKeyConfig::ChromaKeyConfig()
{
red = 0.0;
green = 0.0;
y += 30;
add_subwindow(use_colorpicker = new ChromaKeyUseColorPicker(plugin, this, x1, y));
+ y += use_colorpicker->get_h() + 10;
+ add_subwindow(new ChromaKeyReset(plugin, this, x, y));
+
color_thread = new ChromaKeyColorThread(plugin, this);
update_sample();
return 1;
}
-
ChromaKeyUseValue::ChromaKeyUseValue(ChromaKey *plugin, int x, int y)
: BC_CheckBox(x, y, plugin->config.use_value, _("Use value"))
{
return 1;
}
+ChromaKeyReset::ChromaKeyReset(ChromaKey *plugin, ChromaKeyWindow *gui, int x, int y)
+ : BC_GenericButton(x, y, _("Reset"))
+{
+ this->plugin = plugin;
+ this->gui = gui;
+}
+
+int ChromaKeyReset::handle_event()
+{
+ plugin->config.reset();
+ gui->update_gui();
+ plugin->send_configure_change();
+ return 1;
+}
ChromaKeyUseColorPicker::ChromaKeyUseColorPicker(ChromaKey *plugin,
ChromaKeyWindow *gui,
{
load_configuration();
thread->window->lock_window();
- ((ChromaKeyWindow*)thread->window)->threshold->update(config.threshold);
- ((ChromaKeyWindow*)thread->window)->slope->update(config.slope);
- ((ChromaKeyWindow*)thread->window)->use_value->update(config.use_value);
- ((ChromaKeyWindow*)thread->window)->update_sample();
-
+ ((ChromaKeyWindow *)(thread->window))->update_gui();
thread->window->unlock_window();
}
}
+void ChromaKeyWindow::update_gui()
+{
+ ChromaKeyConfig &config = plugin->config;
+ threshold->update(config.threshold);
+ slope->update(config.slope);
+ use_value->update(config.use_value);
+ update_sample();
+}
+
int ChromaKey::handle_opengl()
{
#ifdef HAVE_GL
{
public:
ChromaKeyConfig();
-
+ void reset();
void copy_from(ChromaKeyConfig &src);
int equivalent(ChromaKeyConfig &src);
void interpolate(ChromaKeyConfig &prev,
ChromaKey *plugin;
};
+class ChromaKeyReset : public BC_GenericButton
+{
+public:
+ ChromaKeyReset(ChromaKey *plugin, ChromaKeyWindow *gui, int x, int y);
+ int handle_event();
+ ChromaKey *plugin;
+ ChromaKeyWindow *gui;
+};
+
class ChromaKeyUseColorPicker : public BC_GenericButton
{
public:
~ChromaKeyWindow();
void create_objects();
+ void update_gui();
void update_sample();
void done_event(int result);
ChromaKeyUseValue *use_value;
ChromaKeyUseColorPicker *use_colorpicker;
ChromaKeySlope *slope;
+ ChromaKeyReset *reset;
BC_SubWindow *sample;
ChromaKey *plugin;
ChromaKeyColorThread *color_thread;
ChromaKeyConfig::ChromaKeyConfig ()
+{
+ reset();
+}
+
+void ChromaKeyConfig::reset()
+
{
red = 0.0;
green = 1.0;
add_subwindow (use_colorpicker =
new ChromaKeyUseColorPicker (plugin, this, x, y));
y += use_colorpicker->get_h() + 10;
+
+ add_subwindow (new ChromaKeyReset (plugin, this, x2+240, y));
add_subwindow (show_mask = new ChromaKeyShowMask (plugin, x2, y));
y += show_mask->get_h() + 5;
return 1;
}
+ChromaKeyReset::ChromaKeyReset (ChromaKeyHSV *plugin, ChromaKeyWindow *gui, int x, int y)
+ :BC_GenericButton(x, y, _("Reset"))
+{
+ this->plugin = plugin;
+ this->gui = gui;
+}
+
+int ChromaKeyReset::handle_event ()
+{
+ plugin->config.reset();
+ gui->update_gui();
+ plugin->send_configure_change();
+ return 1;
+}
+
ChromaKeyUseColorPicker::ChromaKeyUseColorPicker (ChromaKeyHSV * plugin, ChromaKeyWindow * gui, int x, int y)
: BC_GenericButton (x, y,
_
load_configuration();
ChromaKeyWindow *window = (ChromaKeyWindow*)thread->window;
window->lock_window();
- window->min_brightness->update(config.min_brightness);
- window->max_brightness->update(config.max_brightness);
- window->saturation->update(config.saturation);
- window->min_saturation->update(config.min_saturation);
- window->tolerance->update(config.tolerance);
- window->in_slope->update(config.in_slope);
- window->out_slope->update(config.out_slope);
- window->alpha_offset->update(config.alpha_offset);
- window->spill_threshold->update(config.spill_threshold);
- window->spill_amount->update(config.spill_amount);
- window->show_mask->update(config.show_mask);
- window->update_sample();
+ window->update_gui();
window->unlock_window();
}
}
+void ChromaKeyWindow::update_gui()
+{
+ ChromaKeyConfig &config = plugin->config;
+ min_brightness->update(config.min_brightness);
+ max_brightness->update(config.max_brightness);
+ saturation->update(config.saturation);
+ min_saturation->update(config.min_saturation);
+ tolerance->update(config.tolerance);
+ in_slope->update(config.in_slope);
+ out_slope->update(config.out_slope);
+ alpha_offset->update(config.alpha_offset);
+ spill_threshold->update(config.spill_threshold);
+ spill_amount->update(config.spill_amount);
+ show_mask->update(config.show_mask);
+ update_sample();
+}
{
public:
ChromaKeyConfig();
-
+ void reset();
void copy_from(ChromaKeyConfig &src);
int equivalent(ChromaKeyConfig &src);
void interpolate(ChromaKeyConfig &prev,
ChromaKeyWindow *gui;
};
+class ChromaKeyReset : public BC_GenericButton
+{
+public:
+ ChromaKeyReset(ChromaKeyHSV *plugin, ChromaKeyWindow *gui, int x, int y);
+ int handle_event();
+ ChromaKeyHSV *plugin;
+ ChromaKeyWindow *gui;
+};
+
+
class ChromaKeyMinBrightness : public BC_FSlider
{
void create_objects();
void update_sample();
+ void update_gui();
void done_event(int result);
ChromaKeyColor *color;
ChromaKeySpillThreshold *spill_threshold;
ChromaKeySpillAmount *spill_amount;
ChromaKeyShowMask *show_mask;
+ ChromaKeyReset *reset;
BC_SubWindow *sample;
ChromaKeyHSV *plugin;
ChromaKeyColorThread *color_thread;
diff -urN a/configure b/configure
--- a/configure 2017-04-12 19:55:54.000000000 -0600
+++ b/configure 2017-04-16 16:12:23.518837543 -0600
+@@ -5812,7 +5812,7 @@
+ { check_lib openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
+ die "ERROR: libopenjpeg not found"; }
+ enabled libopenmpt && require_pkg_config "libopenmpt >= 0.2.6557" libopenmpt/libopenmpt.h openmpt_module_create
+-enabled libopus && require_pkg_config opus opus_multistream.h opus_multistream_decoder_create
++enabled libopus && use_pkg_config opus opus_multistream.h opus_multistream_decoder_create
+ enabled libpulse && require_pkg_config libpulse pulse/pulseaudio.h pa_context_new
+ enabled librtmp && require_pkg_config librtmp librtmp/rtmp.h RTMP_Socket
+ enabled librubberband && require_pkg_config "rubberband >= 1.8.1" rubberband/rubberband-c.h rubberband_new
@@ -5871,7 +5871,9 @@
die "ERROR: libx264 must be installed and version must be >= 0.118."; } &&
{ check_cpp_condition x264.h "X264_MPEG2" &&