int ClipPopupToMedia::handle_event()
{
- if( mwindow->edl->session->proxy_scale == 1 )
+ if( mwindow->edl->session->proxy_state != PROXY_ACTIVE )
mwindow->clip_to_media();
else
- eprintf("Nesting not allowed when proxy scale != 1");
+ eprintf("Nesting not allowed when proxy active");
return 1;
}
ArrayList<Indexable*> *orig_assets, ArrayList<Indexable*> *proxy_assets)
{
int orig_scale = session->proxy_scale;
- session->proxy_scale = new_scale;
+ int proxy_scale = new_scale;
+ if( !proxy_scale ) proxy_scale = 1;
+ session->proxy_scale = proxy_scale;
int orig_use_scaler = session->proxy_use_scaler;
session->proxy_use_scaler = new_use_scaler;
if( orig_use_scaler ) orig_scale = 1;
- int scale = new_use_scaler ? new_scale : 1;
- int asset_scale = new_scale == 1 && !new_use_scaler ? 0 : scale;
+ int scale = new_use_scaler ? proxy_scale : 1;
+ int asset_scale = !new_scale ? 0 : !new_use_scaler ? 1 : scale;
// change original assets to proxy assets
- int folder_no = new_use_scaler || new_scale != 1 ? AW_PROXY_FOLDER : AW_MEDIA_FOLDER;
+ int folder_no = !new_use_scaler && !new_scale ? AW_MEDIA_FOLDER : AW_PROXY_FOLDER;
for( int i=0,n=proxy_assets->size(); i<n; ++i ) {
Indexable *proxy_idxbl = proxy_assets->get(i);
proxy_idxbl->folder_no = folder_no;
if( !proxy_idxbl->is_asset ) continue;
Asset *proxy_asset = assets->update((Asset *)proxy_idxbl);
+ proxy_asset->proxy_scale = asset_scale;
+ if( !new_scale ) continue; // in case geom resized
proxy_asset->width = proxy_asset->actual_width * scale;
proxy_asset->height = proxy_asset->actual_height * scale;
- proxy_asset->proxy_scale = asset_scale;
}
// rescale to full size asset in read_frame
- if( new_use_scaler ) new_scale = 1;
- rescale_proxy(orig_scale, new_scale);
+ if( new_use_scaler ) proxy_scale = 1;
+ rescale_proxy(orig_scale, proxy_scale);
// replace track contents
for( Track *track=tracks->first; track; track=track->next ) {
}
}
if( has_proxy && !orig_use_scaler )
- clip->rescale_proxy(orig_scale, new_scale);
+ clip->rescale_proxy(orig_scale, proxy_scale);
}
}
#define INSERT_EFFECTS_EXTRA 5
#define INSERT_EFFECTS_MASTER 6
+#define PROXY_INACTIVE 0
+#define PROXY_ACTIVE 1
+#define PROXY_DISABLED 2
+
#endif
playback_buffer = 4096;
playback_cursor_visible = 0;
playback_preload = 0;
+ proxy_state = PROXY_INACTIVE;
proxy_scale = 1;
proxy_disabled_scale = 1;
proxy_use_scaler = 0;
(subtitle_number != ptr->subtitle_number) ||
(interpolate_raw != ptr->interpolate_raw) ||
(white_balance_raw != ptr->white_balance_raw) ||
+ (proxy_state != ptr->proxy_state) ||
(proxy_disabled_scale != ptr->proxy_disabled_scale) ||
(proxy_scale != ptr->proxy_scale) ||
(proxy_use_scaler != ptr->proxy_use_scaler) ||
session->white_balance_raw != white_balance_raw ||
session->decode_subtitles != decode_subtitles ||
session->subtitle_number != subtitle_number ||
+ session->proxy_state != proxy_state ||
session->proxy_disabled_scale != proxy_disabled_scale ||
session->proxy_scale != proxy_scale ||
session->proxy_use_scaler != proxy_use_scaler )
proxy_disabled_scale = file->tag.get_property("PROXY_DISABLED_SCALE", proxy_disabled_scale);
proxy_use_scaler = file->tag.get_property("PROXY_USE_SCALER", proxy_use_scaler);
proxy_auto_scale = file->tag.get_property("PROXY_AUTO_SCALE", proxy_auto_scale);
+ proxy_state = file->tag.get_property("PROXY_STATE", -1);
+ if( proxy_state < 0 ) // convert older edl
+ proxy_state = proxy_scale != 1 ? PROXY_ACTIVE :
+ proxy_disabled_scale != 1 ? PROXY_DISABLED :
+ PROXY_INACTIVE;
return 0;
}
file->tag.set_property("OUTPUTH", output_h);
file->tag.set_property("ASPECTW", aspect_w);
file->tag.set_property("ASPECTH", aspect_h);
+ file->tag.set_property("PROXY_STATE", proxy_state);
file->tag.set_property("PROXY_SCALE", proxy_scale);
file->tag.set_property("PROXY_DISABLED_SCALE", proxy_disabled_scale);
file->tag.set_property("PROXY_USE_SCALER", proxy_use_scaler);
vwindow_meter = session->vwindow_meter;
vwindow_zoom = session->vwindow_zoom;
vwindow_click2play = session->vwindow_click2play;
+ proxy_state = session->proxy_state;
proxy_scale = session->proxy_scale;
proxy_disabled_scale = session->proxy_disabled_scale;
proxy_use_scaler = session->proxy_use_scaler;
printf("EDLSession::dump\n");
printf(" audio_tracks=%d audio_channels=%d sample_rate=%jd\n"
" video_tracks=%d frame_rate=%f output_w=%d output_h=%d aspect_w=%f aspect_h=%f\n"
- " decode subtitles=%d subtitle_number=%d label_cells=%d program_no=%d\n"
- " proxy scale=%d\n disabled_scale=%d, use_scaler=%d, auto_scale=%d\n"
- " proxy_beep=%f render_beep=%f\n",
- audio_tracks, audio_channels, sample_rate, video_tracks,
- frame_rate, output_w, output_h, aspect_w, aspect_h,
- decode_subtitles, subtitle_number, label_cells, program_no,
- proxy_scale, proxy_disabled_scale, proxy_use_scaler, proxy_auto_scale,
- proxy_beep, render_beep);
+ " decode subtitles=%d subtitle_number=%d label_cells=%d program_no=%d render_beep=%f\n"
+ " proxy_* auto_scale=%d state=%d scale=%d disabled_scale=%d use_scaler=%d beep=%f\n",
+ audio_tracks, audio_channels, sample_rate,
+ video_tracks, frame_rate, output_w, output_h, aspect_w, aspect_h,
+ decode_subtitles, subtitle_number, label_cells, program_no, render_beep,
+ proxy_auto_scale, proxy_state, proxy_scale, proxy_disabled_scale,
+ proxy_use_scaler, proxy_beep);
}
int program_no;
int playback_software_position;
// current settings are scaled this much from the original settings
- int proxy_scale;
+ int proxy_scale, proxy_state;
// original proxy_scale when proxy_enable disables/enables proxy
int proxy_disabled_scale;
// upscale geom from proxy to session on read in
settingsmenu->add_item(new SetFormat(mwindow));
settingsmenu->add_item(preferences = new PreferencesMenuitem(mwindow));
- ProxyMenuItem *proxy;
settingsmenu->add_item(proxy = new ProxyMenuItem(mwindow));
proxy->create_objects();
ConvertMenuItem *convert;
#include "module.inc"
#include "new.inc"
#include "plugindialog.inc"
+#include "proxy.inc"
#include "quit.inc"
#include "record.inc"
#include "render.inc"
MixerItems *mixer_items;
LoadLayout *load_layout;
LoadLayout *save_layout;
+ ProxyMenuItem *proxy;
};
// ========================================= edit
load_mode == LOADMODE_REPLACE_CONCATENATE ) &&
(ftype != FILE_IS_XML || edl_mode != LOADMODE_EDL_CLIP) ) {
select_asset(0, 0);
+ edl->session->proxy_state = PROXY_INACTIVE;
edl->session->proxy_scale = 1;
edl->session->proxy_disabled_scale = 1;
edl->session->proxy_use_scaler = 0;
goto_start();
}
- if( ( edl->session->proxy_auto_scale && edl->session->proxy_scale != 1 ) &&
- ( load_mode != LOADMODE_REPLACE && load_mode != LOADMODE_REPLACE_CONCATENATE ) ) {
+ if( edl->session->proxy_state != PROXY_INACTIVE && edl->session->proxy_auto_scale &&
+ load_mode != LOADMODE_REPLACE && load_mode != LOADMODE_REPLACE_CONCATENATE ) {
ArrayList<Indexable *> orig_idxbls;
for( int i=0; i<new_assets.size(); ++i )
orig_idxbls.append(new_assets.get(i));
int MWindow::enable_proxy()
{
int ret = 0;
- if( edl->session->proxy_scale == 1 &&
- edl->session->proxy_disabled_scale != 1 ) {
+ if( edl->session->proxy_state == PROXY_DISABLED ) {
int new_scale = edl->session->proxy_disabled_scale;
int new_use_scaler = edl->session->proxy_use_scaler;
Asset *asset = new Asset;
beep(2000., 1.5, gain);
}
edl->session->proxy_disabled_scale = 1;
+ edl->session->proxy_state = PROXY_ACTIVE;
gui->lock_window("MWindow::to_proxy");
update_project(LOADMODE_REPLACE);
gui->unlock_window();
int MWindow::disable_proxy()
{
- if( edl->session->proxy_scale != 1 &&
- edl->session->proxy_disabled_scale == 1 ) {
- int old_scale = edl->session->proxy_scale, new_scale = 1;
+ if( edl->session->proxy_state == PROXY_ACTIVE ) {
+ int old_scale = edl->session->proxy_scale, new_scale = 0;
int new_use_scaler = edl->session->proxy_use_scaler;
Asset *asset = new Asset;
asset->format = FILE_FFMPEG;
asset->load_defaults(defaults, "PROXY_", 1, 1, 0, 0, 0);
to_proxy(asset, new_scale, new_use_scaler);
asset->remove_user();
+ edl->session->proxy_state = PROXY_DISABLED;
edl->session->proxy_disabled_scale = old_scale;
gui->lock_window("MWindow::to_proxy");
update_project(LOADMODE_REPLACE);
edl->Garbage::add_user();
save_backup();
undo_before(_("proxy"), this);
- int asset_scale = new_scale == 1 ? 0 :
+ int asset_scale = !new_scale ? 0 :
!new_use_scaler ? 1 : new_scale;
ProxyRender proxy_render(this, asset, asset_scale);
// remove all session proxy assets at the at the current proxy_scale
int proxy_scale = edl->session->proxy_scale;
- if( proxy_scale > 1 ) {
+ if( edl->session->proxy_state == PROXY_ACTIVE ) {
Asset *orig_asset = edl->assets->first;
for( ; orig_asset; orig_asset=orig_asset->next ) {
char new_path[BCTEXTLEN];
}
// convert from the proxy assets to the original assets
- edl->set_proxy(1, 0, &proxy_assets, &orig_idxbls);
+ edl->set_proxy(0, 0, &proxy_assets, &orig_idxbls);
// remove the references
for( int i=0; i<proxy_assets.size(); ++i ) {
confirm_paths.set_array_delete();
// convert to new size if not original size
- if( new_scale != 1 ) {
+ if( new_scale ) {
FileSystem fs;
Asset *orig = edl->assets->first;
for( ; orig; orig=orig->next ) {
proxy_render.add_needed(orig_nested, proxy);
}
}
+ edl->session->proxy_state = PROXY_ACTIVE;
}
+ else
+ edl->session->proxy_state = PROXY_INACTIVE;
int result = 0;
// test for existing files
confirm_paths.remove_all_objects();
}
- if( !result )
+ if( !result && new_scale )
result = proxy_render.create_needed_proxies(new_scale);
- if( !result ) // resize project
+ if( !result ) { // resize project
edl->set_proxy(new_scale, new_use_scaler,
&proxy_render.orig_idxbls, &proxy_render.orig_proxies);
-
+ }
undo_after(_("proxy"), LOAD_ALL);
edl->Garbage::remove_user();
restart_brender();
(Indexable*)edit->asset : (Indexable*)edit->nested_edl;
if( !idxbl ) return 0;
char path[BCTEXTLEN];
- if( !edit->asset || edit->track->data_type != TRACK_VIDEO ||
- edl->session->proxy_scale == 1 ||
+// map proxy colors to unproxy colors
+ if( edl->session->proxy_state != PROXY_ACTIVE ||
+ !edit->asset || edit->track->data_type != TRACK_VIDEO ||
ProxyRender::from_proxy_path(path, (Asset*)idxbl, edl->session->proxy_scale) )
strcpy(path, idxbl->path);
char *cp = strrchr(path, '/');
#include "pluginpopup.h"
#include "pluginset.h"
#include "preferences.h"
+#include "proxy.h"
#include "record.h"
#include "recordgui.h"
#include "renderengine.h"
void MWindowGUI::update_proxy_toggle()
{
- int value = mwindow->edl->session->proxy_scale == 1 ? 1 : 0;
+ int value = mwindow->edl->session->proxy_state == PROXY_ACTIVE ? 0 : 1;
proxy_toggle->set_value(value);
- if( mwindow->edl->session->proxy_scale == 1 &&
- mwindow->edl->session->proxy_disabled_scale == 1 )
+ if( mwindow->edl->session->proxy_state == PROXY_INACTIVE )
proxy_toggle->hide();
else
proxy_toggle->show();
: BC_Toggle(x, y, ( !mwindow->edl->session->proxy_use_scaler ?
mwindow->theme->proxy_p_toggle :
mwindow->theme->proxy_s_toggle ),
- mwindow->edl->session->proxy_disabled_scale != 1)
+ mwindow->edl->session->proxy_state == PROXY_DISABLED)
{
this->mwindow = mwindow;
this->mbuttons = mbuttons;
scaler_images = mwindow->edl->session->proxy_use_scaler;
- set_tooltip(mwindow->edl->session->proxy_disabled_scale==1 ?
+ set_tooltip(mwindow->edl->session->proxy_state!=PROXY_DISABLED ?
_("Disable proxy") : _("Enable proxy"));
}
mwindow->enable_proxy();
mwindow->gui->lock_window("ProxyToggle::handle_event");
set_tooltip(!disabled ? _("Disable proxy") : _("Enable proxy"));
+ ProxyDialog *dialog = mwindow->gui->mainmenu->proxy->dialog;
+ if( dialog && dialog->gui ) {
+ dialog->gui->lock_window("ProxyToggle::handle_event");
+ dialog->gui->update();
+ dialog->gui->unlock_window();
+ }
return 1;
}
#include "vrender.h"
#define WIDTH xS(400)
-#define HEIGHT yS(330)
+#define HEIGHT yS(400)
#define MAX_SCALE 16
ProxyMenuItem::ProxyMenuItem(MWindow *mwindow)
bzero(size_text, sizeof(char*) * MAX_SIZES);
bzero(size_factors, sizeof(int) * MAX_SIZES);
- size_text[0] = cstrdup(_("Original size"));
- size_factors[0] = 1;
- total_sizes = 1;
+ size_text[0] = cstrdup(_("off"));
+ size_text[1] = cstrdup(_("1"));
+ size_factors[0] = 0;
+ size_factors[1] = 1;
+ total_sizes = 2;
}
ProxyDialog::~ProxyDialog()
void ProxyDialog::calculate_sizes()
{
- for( int i=1; i<total_sizes; ++i ) {
+ for( int i=2; i<total_sizes; ++i ) {
delete [] size_text[i];
size_text[i] = 0;
size_factors[i] = 0;
}
- total_sizes = 1;
+ total_sizes = 2;
if( !use_scaler ) {
// w,h should stay even for yuv
size_factors[total_sizes++] = 16; size_factors[total_sizes++] = 24;
size_factors[total_sizes++] = 32;
}
- for( int i=1; i<total_sizes; ++i ) {
+ for( int i=2; i<total_sizes; ++i ) {
char string[BCTEXTLEN];
sprintf(string, "1/%d", size_factors[i]);
size_text[i] = cstrdup(string);
void ProxyDialog::handle_close_event(int result)
{
+ gui = 0;
if( result ) return;
if( !File::renders_video(asset) ) {
eprintf(_("Specified format does not render video"));
return;
}
mwindow->edl->session->proxy_auto_scale = auto_scale;
- mwindow->edl->session->proxy_beep = beep;
+ mwindow->edl->session->proxy_beep = beeper_volume;
asset->save_defaults(mwindow->defaults, "PROXY_", 1, 1, 0, 0, 0);
result = mwindow->to_proxy(asset, new_scale, use_scaler);
- if( result >= 0 && beep > 0 && new_scale != 1 ) {
+ if( result >= 0 && beeper_on && beeper_volume > 0 && new_scale >= 1 ) {
if( !result ) {
- mwindow->beep(4000., 0.5, beep);
+ mwindow->beep(4000., 0.5, beeper_volume);
usleep(250000);
- mwindow->beep(1000., 0.5, beep);
+ mwindow->beep(1000., 0.5, beeper_volume);
usleep(250000);
- mwindow->beep(4000., 0.5, beep);
+ mwindow->beep(4000., 0.5, beeper_volume);
}
else
- mwindow->beep(2000., 2.0, beep);
+ mwindow->beep(2000., 2.0, beeper_volume);
}
mwindow->edl->session->proxy_disabled_scale = 1;
mwindow->gui->lock_window("ProxyDialog::handle_close_event");
{
lock_window("ProxyWindow::create_objects");
int margin = mwindow->theme->widget_border;
- int lmargin = margin + xS(10);
+ int xs10 = xS(10), x1 = xS(50);
+ int lmargin = margin + xs10;
+ int x = lmargin, y = margin+yS(10);
dialog->use_scaler = mwindow->edl->session->proxy_use_scaler;
dialog->orig_scale = mwindow->edl->session->proxy_scale;
dialog->auto_scale = mwindow->edl->session->proxy_auto_scale;
- dialog->beep = mwindow->edl->session->proxy_beep;
- dialog->new_scale = dialog->orig_scale;
+ dialog->beeper_on = mwindow->edl->session->proxy_beep > 0 ? 1 : 0;
+ dialog->beeper_volume = mwindow->edl->session->proxy_beep;
+ dialog->new_scale = mwindow->edl->session->proxy_state != PROXY_INACTIVE ?
+ dialog->orig_scale : 0;
dialog->orig_w = mwindow->edl->session->output_w;
dialog->orig_h = mwindow->edl->session->output_h;
if( !dialog->use_scaler ) {
dialog->orig_h *= dialog->orig_scale;
}
- int x = lmargin;
- int y = margin+yS(10);
- add_subwindow(use_scaler = new ProxyUseScaler(this, x, y));
- y += use_scaler->get_h() + margin;
+ add_subwindow(title_bar1 = new BC_TitleBar(xs10, y, get_w()-xS(30), xS(20), xs10,
+ _("Scaling options")));
+ y += title_bar1->get_h() + 3*margin;
BC_Title *text;
+ x = lmargin;
add_subwindow(text = new BC_Title(x, y, _("Scale factor:")));
- x += text->get_w() + margin;
-
- int popupmenu_w = BC_PopupMenu::calculate_w(get_text_width(MEDIUMFONT, dialog->size_text[0])+xS(15));
+ int popupmenu_w = BC_PopupMenu::calculate_w(get_text_width(MEDIUMFONT, dialog->size_text[0])+xS(25));
+ x += text->get_w() + 2*margin;
add_subwindow(scale_factor = new ProxyMenu(mwindow, this, x, y, popupmenu_w, ""));
scale_factor->update_sizes();
- x += scale_factor->get_w() + margin;
-
+ x += popupmenu_w + margin;
ProxyTumbler *tumbler;
add_subwindow(tumbler = new ProxyTumbler(mwindow, this, x, y));
y += tumbler->get_h() + margin;
- x = lmargin;
- add_subwindow(text = new BC_Title(x, y, _("New media dimensions: ")));
+ x = x1;
+ add_subwindow(text = new BC_Title(x, y, _("Media size: ")));
x += text->get_w() + margin;
add_subwindow(new_dimensions = new BC_Title(x, y, ""));
y += new_dimensions->get_h() + margin;
- x = lmargin;
+ x = x1;
add_subwindow(text = new BC_Title(x, y, _("Active Scale: ")));
x += text->get_w() + margin;
add_subwindow(active_scale = new BC_Title(x, y, ""));
+ x += xS(64);
+ add_subwindow(text = new BC_Title(x, y, _("State: ")));
+ x += text->get_w() + margin;
+ add_subwindow(active_state = new BC_Title(x, y, ""));
y += active_scale->get_h() + margin;
- x = lmargin; y += yS(25);
+ add_subwindow(use_scaler = new ProxyUseScaler(this, x1, y));
+ y += use_scaler->get_h() + margin;
+ add_subwindow(auto_scale = new ProxyAutoScale(this, x1, y));
+ y += auto_scale->get_h() + 2*margin;
+
+ x = lmargin; y += yS(15);
format_tools = new ProxyFormatTools(mwindow, this, dialog->asset);
format_tools->create_objects(x, y, 0, 1, 0, 0, 0, 1, 0, 1, // skip the path
0, 0);
+ y += margin;
+ add_subwindow(title_bar2 = new BC_TitleBar(xs10, y, get_w()-xS(30), xS(20), xs10,
+ _("Beep on Done")));
+ y += title_bar2->get_h() + 3*margin;
+
x = lmargin;
- add_subwindow(auto_scale = new ProxyAutoScale(this, x, y));
- y += auto_scale->get_h() + margin;
+ add_subwindow(text = new BC_Title(x, y, _("Volume:")));
+ x += text->get_w() + 2*margin;
add_subwindow(beep_on_done = new ProxyBeepOnDone(this, x, y));
x += beep_on_done->get_w() + margin + xS(10);
- add_subwindow(new BC_Title(x, y+yS(10), _("Beep on done volume")));
-// y += beep_on_done->get_h() + margin;
+ add_subwindow(beep_volume = new ProxyBeepVolume(this, x, y));
update();
void ProxyWindow::update()
{
char string[BCSTRLEN];
- int new_w = dialog->orig_w / dialog->new_scale;
+ dialog->scale_to_text(string, dialog->new_scale);
+ scale_factor->set_text(string);
+ int new_scale = dialog->new_scale;
+ if( new_scale < 1 ) new_scale = 1;
+ int new_w = dialog->orig_w / new_scale;
if( new_w & 1 ) ++new_w;
- int new_h = dialog->orig_h / dialog->new_scale;
+ int new_h = dialog->orig_h / new_scale;
if( new_h & 1 ) ++new_h;
sprintf(string, "%dx%d", new_w, new_h);
new_dimensions->update(string);
- dialog->scale_to_text(string, dialog->new_scale);
- scale_factor->set_text(string);
use_scaler->update();
auto_scale->update();
- int scale = mwindow->edl->session->proxy_scale;
- if( scale == 1 ) scale = mwindow->edl->session->proxy_disabled_scale;
+ int scale = mwindow->edl->session->proxy_state == PROXY_ACTIVE ?
+ mwindow->edl->session->proxy_scale :
+ mwindow->edl->session->proxy_state == PROXY_DISABLED ?
+ mwindow->edl->session->proxy_disabled_scale : 1;
sprintf(string, scale>1 ? "1/%d" : "%d", scale);
active_scale->update(string);
+ const char *state = "";
+ switch( mwindow->edl->session->proxy_state ) {
+ case PROXY_INACTIVE: state = _("Off"); break;
+ case PROXY_ACTIVE: state = _("Active"); break;
+ case PROXY_DISABLED: state = _("Disabled"); break;
+ }
+ active_state->update(state);
+ beep_on_done->update(dialog->beeper_on);
+ beep_volume->update(dialog->beeper_volume*100.f);
}
ProxyUseScaler::ProxyUseScaler(ProxyWindow *pwindow, int x, int y)
- : BC_CheckBox(x, y, pwindow->dialog->use_scaler, _("Use scaler (FFMPEG only)"))
+ : BC_CheckBox(x, y, pwindow->dialog->use_scaler, _("Don't resize project (FFMPEG only)"))
{
this->pwindow = pwindow;
}
void ProxyAutoScale::update()
{
ProxyDialog *dialog = pwindow->dialog;
- if( dialog->new_scale == 1 ) dialog->auto_scale = 0;
+ int can_auto_scale = dialog->new_scale >= 1 ? 1 : 0;
+ if( !can_auto_scale ) dialog->auto_scale = 0;
BC_CheckBox::update(dialog->auto_scale);
- int can_auto_proxy = dialog->new_scale != 1 ? 1 : 0;
- if( !can_auto_proxy && enabled ) disable();
- if( can_auto_proxy && !enabled ) enable();
+ if( !can_auto_scale && enabled ) disable();
+ if( can_auto_scale && !enabled ) enable();
}
int ProxyAutoScale::handle_event()
}
ProxyBeepOnDone::ProxyBeepOnDone(ProxyWindow *pwindow, int x, int y)
- : BC_FPot(x, y, pwindow->dialog->beep*100.f, 0.f, 100.f)
+ : BC_CheckBox(x, y, pwindow->dialog->beeper_on)
{
this->pwindow = pwindow;
}
int ProxyBeepOnDone::handle_event()
{
- pwindow->dialog->beep = get_value()/100.f;
+ pwindow->dialog->beeper_on = get_value();
+ return 1;
+}
+
+ProxyBeepVolume::ProxyBeepVolume(ProxyWindow *pwindow, int x, int y)
+ : BC_FSlider(x, y, 0, xS(160), xS(160), 0.f, 100.f,
+ pwindow->dialog->beeper_volume*100.f, 0)
+{
+ this->pwindow = pwindow;
+}
+
+int ProxyBeepVolume::handle_event()
+{
+ pwindow->dialog->beeper_volume = get_value()/100.f;
+ pwindow->dialog->beeper_on = pwindow->dialog->beeper_volume>0 ? 1 : 0;
pwindow->update();
return 1;
}
#include "bcdialog.h"
#include "cache.inc"
#include "file.inc"
-#include "formattools.inc"
+#include "formattools.h"
#include "loadbalance.h"
#include "mutex.inc"
#include "mwindow.inc"
int orig_scale, new_scale;
int use_scaler, auto_scale;
int orig_w, orig_h;
- float beep;
+ int beeper_on;
+ float beeper_volume;
char *size_text[MAX_SIZES];
int size_factors[MAX_SIZES];
int total_sizes;
ProxyWindow *pwindow;
};
-class ProxyBeepOnDone : public BC_FPot
+class ProxyBeepOnDone : public BC_CheckBox
{
public:
ProxyBeepOnDone(ProxyWindow *pwindow, int x, int y);
- void update();
+ int handle_event();
+
+ ProxyWindow *pwindow;
+};
+
+class ProxyBeepVolume : public BC_FSlider
+{
+public:
+ ProxyBeepVolume(ProxyWindow *pwindow, int x, int y);
int handle_event();
ProxyWindow *pwindow;
MWindow *mwindow;
ProxyDialog *dialog;
+ BC_TitleBar *title_bar1, *title_bar2;
FormatTools *format_tools;
BC_Title *new_dimensions;
BC_Title *active_scale;
+ BC_Title *active_state;
ProxyMenu *scale_factor;
ProxyUseScaler *use_scaler;
ProxyAutoScale *auto_scale;
ProxyBeepOnDone *beep_on_done;
+ ProxyBeepVolume *beep_volume;
};
class ProxyFarm;
int Track::is_armed()
{
- return gang_master()->armed;
+ return armed && gang_master()->armed;
}
int Track::is_ganged()
{
- return gang_master()->ganged;
+ return ganged && gang_master()->ganged;
}
int Track::armed_gang(Track *track)
{
+ if( !track->ganged ) return 0;
if( edl->local_session->gang_tracks == GANG_NONE ) return ganged;
Track *current = gang_master();
+ if( !current->ganged ) return 0;
for(;;) {
if( track == current ) return 1;
current = current->next;
int Track::plays()
{
- return gang_master()->play;
+ return play && gang_master()->play;
}
int Track::index_in(Mixer *mixer)