void AboutPrefs::create_objects()
{
+ lock_window("AboutPrefs::create_objects");
int x, y;
flash();
flush();
+ unlock_window();
}
path[0] = 0;
// Has to be unknown for file probing to succeed
format = FILE_UNKNOWN;
- fformat[0] = 0;
bits = 0;
byte_order = 0;
signed_ = 0;
strcpy(vcodec, "");
strcpy(acodec, "");
+ strcpy(fformat,"mp4");
ff_audio_options[0] = 0;
ff_sample_format[0] = 0;
ff_audio_bitrate = 0;
break;
}
}
+ lock_window("DetailAssetWindow::create_objects");
text = new BC_ScrollTextBox(this, x, y, get_w()-32, 23, info, -len);
text->create_objects(); text->set_text_row(0);
add_subwindow(new BC_OKButton(this));
show_window();
+ unlock_window();
}
void DetailAssetDialog::start(Asset *asset, int x, int y)
void AssetCopyWindow::create_objects()
{
+ lock_window("AssetCopyWindow::create_objects");
BC_Title *title;
int x = 10, y = 10, pad = 5;
add_subwindow(title = new BC_Title(x, y, _("List of asset paths:")));
add_subwindow(new BC_OKButton(this));
show_window();
+ unlock_window();
}
int AssetCopyWindow::resize_event(int w, int h)
void AssetPasteWindow::create_objects()
{
+ lock_window("AssetPasteWindow::create_objects()");
BC_Title *title;
int x = 10, y = 10, pad = 5;
add_subwindow(title = new BC_Title(x, y, _("Enter list of asset paths:")));
add_subwindow(new BC_OKButton(this));
add_subwindow(new BC_CancelButton(this));
show_window();
+ unlock_window();
}
int AssetPasteWindow::resize_event(int w, int h)
open_render_engine(edl, 0);
render_video(0, gui->temp_picon);
close_render_engine();
- gui->lock_window("AssetPicon::create_objects 0");
icon_vframe = new VFrame(0,
-1, pixmap_w, pixmap_h, BC_RGB888, -1);
icon_vframe->transfer_from(gui->temp_picon);
pixmap_w = icon_vframe->get_w();
pixmap_h = icon_vframe->get_h();
}
+ gui->lock_window("AssetPicon::create_objects 0");
icon = new BC_Pixmap(gui, pixmap_w, pixmap_h);
icon->draw_vframe(icon_vframe,
0, 0, pixmap_w, pixmap_h, 0, 0);
void AWindowRemovePluginGUI::create_objects()
{
+ lock_window("AWindowRemovePluginGUI::create_objects");
BC_Button *ok_button = new BC_OKButton(this);
add_subwindow(ok_button);
BC_Button *cancel_button = new BC_CancelButton(this);
0, 0, 1, 0, 0, LISTBOX_SINGLE, ICON_LEFT, 0);
add_subwindow(list);
show_window();
+ unlock_window();
}
int AWindowRemovePlugin::remove_plugin(PluginServer *plugin, ArrayList<BC_ListBoxItem*> &folder)
void ChannelEditWindow::create_objects()
{
+ lock_window("ChannelEditWindow::create_objects");
int x = 10, y = 10;
// Create channel list
edit_thread = new ChannelEditEditThread(this, channel_picker);
picture_thread = new ChannelEditPictureThread(channel_picker);
show_window();
+ unlock_window();
}
int ChannelEditWindow::close_event()
}
-
-
-
-
-
-
-
-
-
-
-// ========================= confirm overwrite by channel scannin
-
+// ========================= confirm overwrite by channel scanning
ConfirmScan::ConfirmScan(ChannelEditWindow *gui, int x, int y)
: BC_Window(_(PROGRAM_NAME ": Scan confirm"),
- x,
- y,
- 350,
- BC_OKButton::calculate_h() + 130,
- 0,
- 0,
- 0,
- 0,
- 1)
+ x, y, 350, BC_OKButton::calculate_h() + 130,
+ 0, 0, 0, 0, 1)
{
this->gui = gui;
}
void ConfirmScan::create_objects()
{
+ lock_window("ConfirmScan::create_objects");
int x = 10, y = 10;
int y2 = 0, x2 = 0;
BC_Title *title;
add_subwindow(new BC_OKButton(this));
add_subwindow(new BC_CancelButton(this));
show_window();
+ unlock_window();
}
-
-
-
-
-
-
ConfirmScanThread::ConfirmScanThread(ChannelEditWindow *gui)
: BC_DialogThread()
{
: BC_Window(_(PROGRAM_NAME ": Edit Channel"),
channel_picker->parent_window->get_abs_cursor_x(1),
channel_picker->parent_window->get_abs_cursor_y(1),
- 390,
- 300,
- 390,
- 300,
- 0,
- 0,
- 1)
+ 390, 300, 390, 300, 0, 0, 1)
{
this->channel_picker = channel_picker;
this->window = window;
ChannelEditEditWindow::~ChannelEditEditWindow()
{
}
+
void ChannelEditEditWindow::create_objects(Channel *channel)
{
+ lock_window("ChannelEditEditWindow::create_objects");
this->new_channel = channel;
Channel *channel_usage = channel_picker->get_channel_usage();
title_text = 0;
x += 200;
add_subwindow(new BC_CancelButton(this));
show_window();
+ unlock_window();
}
ChannelEditEditTitle::ChannelEditEditTitle(int x,
: BC_Window(_(PROGRAM_NAME ": Picture"),
channel_picker->mwindow->session->picture_x,
channel_picker->mwindow->session->picture_y,
- calculate_w(channel_picker),
- calculate_h(channel_picker),
- calculate_w(channel_picker),
- calculate_h(channel_picker))
+ calculate_w(channel_picker), calculate_h(channel_picker),
+ calculate_w(channel_picker), calculate_h(channel_picker))
{
this->thread = thread;
this->channel_picker = channel_picker;
void ChannelEditPictureWindow::create_objects()
{
+ lock_window("ChannelEditPictureWindow::create_objects");
int x = 10, y = 10;
int widget_border = ((Theme*)channel_picker->get_theme())->widget_border;
int x1 = get_w() - BC_Pot::calculate_w() * 2 - widget_border * 2;
y += pad;
add_subwindow(new BC_OKButton(this));
show_window();
+ unlock_window();
}
int ChannelEditPictureWindow::translation_event()
void ChanSearchGUI::create_objects()
{
+ lock_window("ChanSearchGUI::create_objects");
int pady = BC_TextBox::calculate_h(this, MEDIUMFONT, 0, 1) + 5;
int padx = BC_Title::calculate_w(this, (char*)"X", MEDIUMFONT);
int x = padx/2, y = pady/4;
set_icon(iwindow->mwindow->theme->get_image("record_icon"));
search_text->activate();
+ unlock_window();
}
ChanSearchGUI::ChanSearchGUI(ChanSearch *cswindow)
void ChannelInfoGUI::create_objects()
{
+ lock_window("ChannelInfoGUI::create_objects");
panel = new ChannelPanel(this,0,0,panel_w,panel_h);
add_subwindow(panel);
panel->create_objects();
channel_search = new ChanSearch(iwindow);
show_window();
+ unlock_window();
}
ChannelInfoGUI::ChannelInfoGUI(ChannelInfo *iwindow,
void CropVideoWindow::create_objects()
{
+ lock_window("CropVideoWindow::create_objects");
int x = 10, y = 10;
add_subwindow(new BC_Title(x, y, _("Select a region to crop in the video output window")));
y += 30;
add_subwindow(new BC_OKButton(x, y));
x = get_w() - 100;
add_subwindow(new BC_CancelButton(x, y));
+ unlock_window();
}
-
-
void ConfirmDeleteAllIndexes::create_objects()
{
+ lock_window("ConfirmDeleteAllIndexes::create_objects");
int x = 10, y = 10;
add_subwindow(new BC_Title(x, y, string));
add_subwindow(new BC_OKButton(x, y));
x = get_w() - 100;
add_subwindow(new BC_CancelButton(x, y));
+ unlock_window();
}
void EditPopupTitleWindow::create_objects()
{
+ lock_window("EditPopupTitleWindow::create_objects");
int x = 5;
int y = 10;
show_window();
flush();
+ unlock_window();
}
void EffectTipWindow::create_objects()
{
+ lock_window("EffectTipWindow::create_objects");
int x = 10, y = 10;
BC_Title *title;
add_subwindow(title = new BC_Title(x, y, thread->effect));
add_subwindow(tip_text = new BC_Title(x+5, y, thread->text));
add_subwindow(new BC_OKButton(this));
show_window(1);
-};
+ unlock_window();
+}
EffectTipItem::EffectTipItem(AWindowGUI *gui)
: BC_MenuItem(_("Info"))
#include "edits.h"
#include "edl.h"
#include "edlsession.h"
-#include "errorbox.h"
#include "file.h"
#include "filesystem.h"
#include "filexml.h"
#include "language.h"
#include "localsession.h"
+#include "mainerror.h"
#include "mainsession.h"
#include "mutex.h"
#include "mwindowgui.h"
{
FILE *fh;
fh = fopen(path, "w+");
+ if( !fh ) {
+ eprintf("unable to open file: %s", path);
+ return;
+ }
// We currently only support exporting one track at a time
// Find the track...
void ExportEDLWindow::create_objects()
{
+ lock_window("ExportEDLWindow::create_objects");
int x = 5, y = 5;
add_subwindow(new BC_Title(x, y,
_("Select a file to export to:")));
add_subwindow(new BC_OKButton(this));
add_subwindow(new BC_CancelButton(this));
show_window();
+ unlock_window();
}
int FeatherEditsWindow::create_objects(int audio, int video)
{
+ lock_window("FeatherEditsWindow::create_objects");
int x = 10;
int y = 10;
this->audio = audio;
add_subwindow(new BC_OKButton(x, y));
add_subwindow(new BC_CancelButton(x, y));
return 0;
+ unlock_window();
}
FeatherEditsTextBox::FeatherEditsTextBox(FeatherEditsWindow *window, char *text, int x, int y)
: BC_Window(_(PROGRAM_NAME ": Audio Compression"),
parent_window->get_abs_cursor_x(1),
parent_window->get_abs_cursor_y(1),
- 350,
- 250)
+ 350, 250)
{
this->parent_window = parent_window;
this->asset = asset;
void DVConfigAudio::create_objects()
{
+ lock_window("DVConfigAudio::create_objects");
add_tool(new BC_Title(10, 10, _("There are no audio options for this format")));
add_subwindow(new BC_OKButton(this));
+ unlock_window();
}
int DVConfigAudio::close_event()
}
-
-
-
-
DVConfigVideo::DVConfigVideo(BC_WindowBase *parent_window, Asset *asset)
: BC_Window(_(PROGRAM_NAME ": Video Compression"),
parent_window->get_abs_cursor_x(1),
parent_window->get_abs_cursor_y(1),
- 350,
- 250)
+ 350, 250)
{
this->parent_window = parent_window;
this->asset = asset;
void DVConfigVideo::create_objects()
{
+ lock_window("DVConfigVideo::create_objects");
add_tool(new BC_Title(10, 10, _("There are no video options for this format")));
add_subwindow(new BC_OKButton(this));
+ unlock_window();
}
int DVConfigVideo::close_event()
void FFOptionsWindow::create_objects()
{
+ lock_window("FFOptionsWindow::create_objects");
BC_Title *title;
int x0 = 10, y0 = 10;
int x = x0, y = y0;
options.initialize(this, FF_KIND_CODEC);
draw();
show_window(1);
+ unlock_window();
}
void FFOptionsWindow::draw()
y += 30;
add_subwindow(new BC_Title(x, y, _("Bits:")));
- bitspopup = new BitsPopup(this,
- x2,
- y,
- &asset->bits,
- 0,
- 1,
- 1,
- 0,
- 1);
+ bitspopup = new BitsPopup(this, x2, y,
+ &asset->bits, 0, 1, 1, 0, 1);
bitspopup->create_objects();
y += 30;
}
FileFormatChannels::FileFormatChannels(int x, int y, FileFormat *fwindow, char *text)
- : BC_TumbleTextBox(fwindow,
- (int)atol(text),
- (int)1,
- (int)MAXCHANNELS,
- x,
- y,
- 50)
+ : BC_TumbleTextBox(fwindow, (int)atol(text), (int)1, (int)MAXCHANNELS, x, y, 50)
{
this->fwindow = fwindow;
}
: BC_Window(_(PROGRAM_NAME ": Video Compression"),
parent_window->get_abs_cursor_x(1),
parent_window->get_abs_cursor_y(1),
- 400,
- 200)
+ 400, 200)
{
this->parent_window = parent_window;
this->asset = asset;
{
PRINT_TRACE
- mjpeg_t *mjpeg = mjpeg_new(asset->width,
- asset->height,
- 1);
- mjpeg_decompress(mjpeg,
- data->get_data(),
- data->get_compressed_size(),
- 0,
- frame->get_rows(),
- frame->get_y(),
- frame->get_u(),
- frame->get_v(),
- frame->get_color_model(),
- file->cpus);
+ mjpeg_t *mjpeg = mjpeg_new(asset->width, asset->height, 1);
+ mjpeg_decompress(mjpeg, data->get_data(), data->get_compressed_size(),
+ 0, frame->get_rows(),
+ frame->get_y(), frame->get_u(), frame->get_v(),
+ frame->get_color_model(), file->cpus);
mjpeg_delete(mjpeg);
PRINT_TRACE
return 0;
int FileJPEGList::write_frame(VFrame *frame, VFrame *data)
{
- mjpeg_t *mjpeg = mjpeg_new(asset->width,
- asset->height,
- 1);
- mjpeg_compress(mjpeg,
- frame->get_rows(),
- frame->get_y(),
- frame->get_u(),
- frame->get_v(),
- frame->get_color_model(),
- file->cpus);
+ mjpeg_t *mjpeg = mjpeg_new(asset->width, asset->height, 1);
+ mjpeg_compress(mjpeg, frame->get_rows(),
+ frame->get_y(), frame->get_u(), frame->get_v(),
+ frame->get_color_model(), file->cpus);
data->allocate_compressed_data(mjpeg_output_size(mjpeg));
bcopy(mjpeg_output_buffer(mjpeg), frame->get_data(), mjpeg_output_size(mjpeg));
mjpeg_delete(mjpeg);
}
-
-
-
-
-
-
-
-
-
JPEGConfigVideo::JPEGConfigVideo(BC_WindowBase *parent_window, Asset *asset)
: BC_Window(_(PROGRAM_NAME ": Video Compression"),
parent_window->get_abs_cursor_x(),
parent_window->get_abs_cursor_y(),
- 400,
- 100)
+ 400, 100)
{
this->parent_window = parent_window;
this->asset = asset;
int x = 10, y = 10;
lock_window("JPEGConfigVideo::create_objects");
add_subwindow(new BC_Title(x, y, _("Quality:")));
- add_subwindow(new BC_ISlider(x + 80,
- y,
- 0,
- 200,
- 200,
- 0,
- 100,
- asset->quality,
- 0,
- 0,
- &asset->quality));
+ add_subwindow(new BC_ISlider(x + 80, y, 0,
+ 200, 200, 0, 100, asset->quality,
+ 0, 0, &asset->quality));
add_subwindow(new BC_OKButton(this));
unlock_window();
return 1;
}
-
-
-
-
-
-
: BC_Window(_(PROGRAM_NAME ": Audio Compression"),
parent_window->get_abs_cursor_x(1),
parent_window->get_abs_cursor_y(1),
- 310,
- 120,
- -1,
- -1,
- 0,
- 0,
- 1)
+ 310, 120, -1, -1, 0, 0, 1)
{
this->parent_window = parent_window;
this->asset = asset;
}
-
-
-
-
-
MPEGLayer::MPEGLayer(int x, int y, MPEGConfigAudio *gui)
: BC_PopupMenu(x, y, 100, layer_to_string(gui->asset->ampeg_derivative))
{
MPEGABitrate::MPEGABitrate(int x, int y, MPEGConfigAudio *gui)
- : BC_PopupMenu(x,
- y,
- 100,
+ : BC_PopupMenu(x, y, 100,
bitrate_to_string(gui->string, gui->asset->ampeg_bitrate))
{
this->gui = gui;
: BC_Window(_(PROGRAM_NAME ": Video Compression"),
parent_window->get_abs_cursor_x(1),
parent_window->get_abs_cursor_y(1),
- 500,
- 400,
- -1,
- -1,
- 0,
- 0,
- 1)
+ 500, 400, -1, -1, 0, 0, 1)
{
this->parent_window = parent_window;
this->asset = asset;
: BC_Window(_(PROGRAM_NAME ": Audio Compression"),
parent_window->get_abs_cursor_x(1),
parent_window->get_abs_cursor_y(1),
- 350,
- 250)
+ 350, 250)
{
this->parent_window = parent_window;
this->asset = asset;
: BC_Window(_(PROGRAM_NAME ": Video Compression"),
parent_window->get_abs_cursor_x(1),
parent_window->get_abs_cursor_y(1),
- 450,
- 220)
+ 450, 220)
{
this->parent_window = parent_window;
this->asset = asset;
y += 30;
add_subwindow(new BC_Title(x, y, _("Quality:")));
- add_subwindow(new BC_ISlider(x + 80,
- y,
- 0,
- 200,
- 200,
- 0,
- 63,
- asset->theora_quality,
- 0,
- 0,
- &asset->theora_quality));
-
+ add_subwindow(new BC_ISlider(x + 80, y, 0,
+ 200, 200, 0, 63,
+ asset->theora_quality, 0,
+ 0, &asset->theora_quality));
add_subwindow(fixed_quality = new OGGTheoraFixedQuality(x2, y, this));
y += 30;
}
-
-
int OGGConfigVideo::close_event()
{
set_done(0);
void PNGConfigVideo::create_objects()
{
- lock_window("PNGConfigVideo::create_objects()");
+ lock_window("PNGConfigVideo::create_objects");
int x = 10, y = 10;
add_subwindow(new PNGUseAlpha(this, x, y));
add_subwindow(new BC_OKButton(this));
{
this->gui = gui;
this->asset = asset;
- lock_window("PPMConfigVideo::create_objects()");
+}
+
+void PPMConfigVideo::create_objects()
+{
+ lock_window("PPMConfigVideo::create_objects");
int x = 10, y = 10;
add_subwindow(new BC_Title(x, y, _("PPM, RGB raw only")));
add_subwindow(new BC_OKButton(this));
{
if(video_options) {
PPMConfigVideo *window = new PPMConfigVideo(parent_window, asset);
+ window->create_objects();
format_window = window;
window->run_window();
delete window;
{
public:
PPMConfigVideo(BC_WindowBase *gui, Asset *asset);
+ void create_objects();
BC_WindowBase *gui;
Asset *asset;
void SndFileConfig::create_objects()
{
- lock_window("SndFileConfig::create_objects()");
+ lock_window("SndFileConfig::create_objects");
int x = 10, y = 10;
bits_popup = 0;
void TGAConfigVideo::create_objects()
{
- lock_window("TGAConfigVideo::create_objects()");
+ lock_window("TGAConfigVideo::create_objects");
int x = 10, y = 10;
add_subwindow(new BC_Title(x, y, _("Compression:")));
void TIFFConfigVideo::create_objects()
{
- lock_window("TIFFConfigVideo::create_objects()");
+ lock_window("TIFFConfigVideo::create_objects");
int x = 10, y = 10;
add_subwindow(new BC_Title(x, y, _("Colorspace:")));
void FormatAWindow::create_objects()
{
+ lock_window("FormatAWindow::create_objects");
int x;
int init_x;
int y = 10;
x = init_x;
add_subwindow(new BC_OKButton(x + 170, y));
+ unlock_window();
}
-
FormatVWindow::FormatVWindow(Asset *asset, int recording)
: BC_Window(_(PROGRAM_NAME ": File format"), 410, 115, 0, 0)
{ this->asset = asset; this->recording = recording; }
void FormatVWindow::create_objects()
{
+ lock_window("FormatVWindow::create_objects");
int x, y = 10;
int init_x;
}
add_subwindow(new BC_OKButton(x + 170, y));
+ unlock_window();
}
int FormatVWindow::close_event()
}
-
-
-
-
-
FormatQuality::FormatQuality(int x, int y, Asset *asset, int default_)
- : BC_ISlider(x,
- y,
- 0,
- 100,
- 100,
- 0,
- 100,
- default_,
- 1)
+ : BC_ISlider(x, y, 0, 100, 100, 0, 100, default_, 1)
{
this->asset = asset;
}
}
-
FormatBits::FormatBits(int x, int y, Asset *asset)
: BitsPopup(x, y, asset)
{ this->asset = asset; }
}
-
FormatDither::FormatDither(int x, int y, int *dither)
: BC_CheckBox(x, y, *dither, _("Dither"))
{ this->dither = dither; }
}
-
-
-
-
FormatHILO::FormatHILO(int x, int y, Asset *asset)
: BC_Radial(x, y, asset->byte_order ^ 1)
{
void GWindowGUI::create_objects()
{
int x = 10, y = 10;
- lock_window("GWindowGUI::create_objects 1");
+ lock_window("GWindowGUI::create_objects");
for( int i=0; i<(int)(sizeof(toggle_order)/sizeof(toggle_order[0])); ++i ) {
toggleinfo *tp = &toggle_order[i];
void LabelEditWindow::create_objects()
{
+ lock_window("LabelEditWindow::create_objects");
this->label = thread->label;
int x = 10, y = 10;
add_subwindow(new BC_CancelButton(this));
show_window();
textbox->activate();
+ unlock_window();
}
LabelEditComments::LabelEditComments(LabelEditWindow *window, int x, int y, int w, int rows)
void MainErrorGUI::create_objects()
{
-
+ lock_window("MainErrorGUI::create_objects");
BC_Button *button;
add_subwindow(button = new BC_OKButton(this));
int x = 10, y = 10;
add_subwindow(title = new BC_Title(x, y, _("The following errors occurred:")));
y += title->get_h() + 5;
- add_subwindow(list = new BC_ListBox(x,
- y,
- get_w() - 20,
- button->get_y() - y - 5,
- LISTBOX_TEXT, // Display text list or icons
- &thread->errors, // Each column has an ArrayList of BC_ListBoxItems.
- 0, // Titles for columns. Set to 0 for no titles
- 0, // width of each column
- 1, // Total columns. Only 1 in icon mode
- 0, // Pixel of top of window.
- 0, // If this listbox is a popup window with a button
- LISTBOX_SINGLE, // Select one item or multiple items
- ICON_LEFT, // Position of icon relative to text of each item
+ add_subwindow(list = new BC_ListBox(x, y,
+ get_w() - 20, button->get_y() - y - 5,
+ LISTBOX_TEXT, // Display text list or icons
+ &thread->errors, // Each column has an ArrayList of BC_ListBoxItems.
+ 0, // Titles for columns. Set to 0 for no titles
+ 0, // width of each column
+ 1, // Total columns. Only 1 in icon mode
+ 0, // Pixel of top of window.
+ 0, // If this listbox is a popup window with a button
+ LISTBOX_SINGLE, // Select one item or multiple items
+ ICON_LEFT, // Position of icon relative to text of each item
0));
show_window();
+ unlock_window();
}
int MainErrorGUI::resize_event(int w, int h)
void ManualGotoWindow::create_objects()
{
+ lock_window("ManualGotoWindow::create_objects");
int x = 76, y = 5;
BC_Title *title = new BC_Title(x - 2, y, _("hour min sec msec"), SMALLFONT);
add_subwindow(new BC_OKButton(this));
add_subwindow(new BC_CancelButton(this));
+ unlock_window();
}
MenuEffectPrompt::calculate_h(mwindow->gui),
MenuEffectPrompt::calculate_w(mwindow->gui),
MenuEffectPrompt::calculate_h(mwindow->gui),
- 0,
- 0,
- 1)
+ 0, 0, 1)
{
}
void MenuEffectPrompt::create_objects()
{
+ lock_window("MenuEffectPrompt::create_objects");
int x = 10, y = 10;
BC_Title *title;
add_subwindow(title = new BC_Title(x, y, PROMPT_TEXT));
add_subwindow(new BC_CancelButton(this));
show_window();
raise_window();
+ unlock_window();
}
void MeterPanel::init_meters(int dmix)
{
+ subwindow->lock_window("MeterPanel::init_meters");
for(int i = 0; i < meter_count; i++)
{
meters.values[i]->reset(dmix);
}
+ subwindow->unlock_window();
}
void MeterPanel::update_peak(int number, float value)
void MWindow::close_mixers(int destroy)
{
+ ArrayList<ZWindow*> closed;
zwindows_lock->lock("MWindow::close_mixers");
for( int i=zwindows.size(); --i>=0; ) {
ZWindow *zwindow = zwindows[i];
zgui->lock_window("MWindow::select_zwindow 0");
zgui->set_done(0);
zgui->unlock_window();
+ closed.append(zwindow);
}
zwindows_lock->unlock();
- for( int i=0; i<zwindows.size(); ++i ) {
- ZWindow *zwindow = zwindows[i];
- if( zwindow->idx < 0 ) continue;
- zwindow->close_window();
+ for( int i=0; i<closed.size(); ++i ) {
+ ZWindow *zwindow = closed[i];
+ zwindow->join();
}
}
void MWindow::init_gui()
{
gui = new MWindowGUI(this);
- gui->lock_window("MWindow::init_gui");
gui->create_objects();
- gui->unlock_window();
gui->load_defaults(defaults);
}
if( edl->session->proxy_scale == 1 &&
edl->session->proxy_disabled_scale != 1 ) {
int new_scale = edl->session->proxy_disabled_scale;
+ int new_use_scaler = edl->session->proxy_use_scaler;
edl->session->proxy_disabled_scale = 1;
Asset *asset = new Asset;
asset->format = FILE_FFMPEG;
asset->load_defaults(defaults, "PROXY_", 1, 1, 0, 0, 0);
- ret = to_proxy(asset, new_scale);
+ ret = to_proxy(asset, new_scale, new_use_scaler);
asset->remove_user();
if( ret > 0 )
beep(2000., 1.5, 0.5);
{
if( edl->session->proxy_scale != 1 &&
edl->session->proxy_disabled_scale == 1 ) {
+ int new_scale = 1;
+ int new_use_scaler = edl->session->proxy_use_scaler;
edl->session->proxy_disabled_scale = edl->session->proxy_scale;
Asset *asset = new Asset;
asset->format = FILE_FFMPEG;
asset->load_defaults(defaults, "PROXY_", 1, 1, 0, 0, 0);
- to_proxy(asset, 1);
+ to_proxy(asset, new_scale, new_use_scaler);
asset->remove_user();
}
return 1;
}
-int MWindow::to_proxy(Asset *asset, int new_scale)
+int MWindow::to_proxy(Asset *asset, int new_scale, int new_use_scaler)
{
ArrayList<Indexable*> orig_idxbls;
ArrayList<Indexable*> proxy_assets;
// revert project to original size from current size
// remove all session proxy assets at the at the current proxy_scale
int proxy_scale = edl->session->proxy_scale;
- int proxy_use_scaler = edl->session->proxy_use_scaler;
if( proxy_scale > 1 ) {
Asset *orig_asset = edl->assets->first;
result = proxy_render.create_needed_proxies(new_scale);
if( !result ) // resize project
- edl->set_proxy(new_scale, proxy_use_scaler,
+ edl->set_proxy(new_scale, new_use_scaler,
&proxy_render.orig_idxbls, &proxy_render.orig_proxies);
undo->update_undo_after(_("proxy"), LOAD_ALL);
check_language();
init_preferences();
if(splash_window)
- splash_window->operation->update(_("Initializing Plugins"));
+ splash_window->update_status(_("Initializing Plugins"));
init_plugins(this, preferences);
if(debug) PRINT_TRACE
init_ladspa_plugins(this, preferences);
if(debug) PRINT_TRACE
init_plugin_tips(*plugindb, cin_lang);
if(splash_window)
- splash_window->operation->update(_("Initializing GUI"));
+ splash_window->update_status(_("Initializing GUI"));
if(debug) PRINT_TRACE
init_theme();
init_error();
if(splash_window)
- splash_window->operation->update(_("Initializing Fonts"));
+ splash_window->update_status(_("Initializing Fonts"));
char string[BCTEXTLEN];
strcpy(string, preferences->plugin_dir);
strcat(string, "/" FONT_SEARCHPATH);
void beep(double freq, double secs, double gain);
int enable_proxy();
int disable_proxy();
- int to_proxy(Asset *asset, int new_scale);
+ int to_proxy(Asset *asset, int new_scale, int new_use_scaler);
ProxyBeep *proxy_beep;
void dump_plugins(FILE *fp=stdout);
}
}
- if( calling_window_gui != gui )
- gui->unlock_window();
-
awindow->gui->async_update_assets();
cwindow->refresh_frame(CHANGE_ALL);
}
}
- if( calling_window_gui != gui )
- gui->unlock_window();
-
awindow->gui->async_update_assets();
cwindow->refresh_frame(CHANGE_ALL);
void MWindowGUI::create_objects()
{
+ lock_window("MWindowGUI::create_objects");
const int debug = 0;
resource_thread = new ResourceThread(mwindow, this);
pane[TOP_LEFT_PANE]->canvas->activate();
if(debug) printf("MWindowGUI::create_objects %d\n", __LINE__);
+ unlock_window();
}
void MWindowGUI::redraw_time_dependancies()
{
if( mwindow->edl->session->proxy_scale == 1 &&
mwindow->edl->session->proxy_disabled_scale == 1 )
- proxy_toggle->hide_window();
+ proxy_toggle->hide();
else
- proxy_toggle->show_window();
+ proxy_toggle->show();
}
void MWindowGUI::update_plugintoggles()
ProxyToggle::ProxyToggle(MWindow *mwindow, MButtons *mbuttons, int x, int y)
- : BC_Toggle(x, y, mwindow->theme->proxy_toggle,
+ : 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)
{
this->mwindow = mwindow;
this->mbuttons = mbuttons;
+ scaler_images = mwindow->edl->session->proxy_use_scaler;
set_tooltip(mwindow->edl->session->proxy_disabled_scale==1 ?
_("Disable proxy") : _("Enable proxy"));
}
+void ProxyToggle::show()
+{
+ int use_scaler = mwindow->edl->session->proxy_use_scaler;
+ if( scaler_images != use_scaler )
+ set_images(!(scaler_images=use_scaler) ?
+ mwindow->theme->proxy_p_toggle :
+ mwindow->theme->proxy_s_toggle );
+ draw_face(1, 0);
+ if( is_hidden() )
+ show_window();
+}
+
+void ProxyToggle::hide()
+{
+ if( !is_hidden() )
+ hide_window();
+}
+
ProxyToggle::~ProxyToggle()
{
}
~ProxyToggle();
int handle_event();
int keypress_event();
+ void show();
+ void hide();
MWindow *mwindow;
MButtons *mbuttons;
+ int scaler_images;
};
NewFolder::NewFolder(MWindow *mwindow, AWindowGUI *awindow, int x, int y)
: BC_Window(_(PROGRAM_NAME ": New folder"),
- x,
- y,
- 320,
- 120,
- 0,
- 0,
- 0,
- 0,
- 1)
+ x, y, 320, 120, 0, 0, 0, 0, 1)
{
this->mwindow = mwindow;
this->awindow = awindow;
void NewFolder::create_objects()
{
+ lock_window("NewFolder::create_objects");
int x = 10, y = 10;
add_tool(new BC_Title(x, y, _("Enter the name of the folder:")));
y += 20;
x = get_w() - 100;
add_subwindow(new BC_CancelButton(x, y));
show_window();
+ unlock_window();
}
const char* NewFolder::get_text()
PluginClientWindow::PluginClientWindow(PluginClient *client,
- int w,
- int h,
- int min_w,
- int min_h,
- int allow_resize)
+ int w, int h, int min_w, int min_h, int allow_resize)
: BC_Window(client->gui_string,
client->window_x /* - w / 2 */,
client->window_y /* - h / 2 */,
}
void PluginDialogThread::start_window(Track *track,
- Plugin *plugin,
- const char *title,
- int is_mainmenu,
- int data_type)
+ Plugin *plugin, const char *title, int is_mainmenu, int data_type)
{
if(!BC_DialogThread::is_running())
{
void ProbeEditWindow::create_objects()
{
+ lock_window("ProbeEditWindow::create_objects");
pb_enabled = new BC_Pixmap(this,
BC_WindowBase::get_resources()->listbox_up,
PIXMAP_ALPHA);
list_update();
show_window();
+ unlock_window();
}
ProbeEditOK::ProbeEditOK(ProbeEditWindow *pb_window)
eprintf("Specified format does not render video");
return;
}
- mwindow->edl->session->proxy_use_scaler = use_scaler;
mwindow->edl->session->proxy_auto_scale = auto_scale;
mwindow->edl->session->proxy_beep = beep;
mwindow->edl->session->proxy_disabled_scale = 1;
+ mwindow->gui->lock_window("ProxyDialog::handle_close_event");
+ mwindow->gui->update_proxy_toggle();
+ mwindow->gui->unlock_window();
asset->save_defaults(mwindow->defaults, "PROXY_", 1, 1, 0, 0, 0);
- result = mwindow->to_proxy(asset, new_scale);
+ result = mwindow->to_proxy(asset, new_scale, use_scaler);
if( result >= 0 && beep && new_scale != 1 ) {
static struct { double freq, secs, gain; }
tone[2] = { { 2000., 1.5, 0.5 }, { 4000., 0.25, 0.5 } };
void RecConfirmDelete::create_objects(char *string)
{
+ lock_window("RecConfirmDelete::create_objects");
char string2[256];
int x = 10, y = 10;
sprintf(string2, _("Delete this file and %s?"), string);
add_subwindow(new BC_OKButton(x, y));
x = get_w() - 100;
add_subwindow(new BC_CancelButton(x, y));
+ unlock_window();
}
#include "videodevice.inc"
RecordWindow::RecordWindow(MWindow *mwindow, Record *record, int x, int y)
- : BC_Window(_(PROGRAM_NAME ": Record"),
- x,
- y,
- RECORD_WINDOW_WIDTH,
- RECORD_WINDOW_HEIGHT,
- (int)BC_INFINITY,
- (int)BC_INFINITY,
- 0,
- 0,
- 1)
+ : BC_Window(_(PROGRAM_NAME ": Record"), x, y,
+ RECORD_WINDOW_WIDTH, RECORD_WINDOW_HEIGHT,
+ (int)BC_INFINITY, (int)BC_INFINITY, 0, 0, 1)
{
this->mwindow = mwindow;
this->record = record;
// delete loadmode;
}
-
-
void RecordWindow::create_objects()
{
-//printf("RecordWindow::create_objects 1\n");
+ lock_window("RecordWindow::create_objects");
add_subwindow(new BC_Title(5, 5, _("Select a file to record to:")));
-//printf("RecordWindow::create_objects 1\n");
int x = 5, y = 25;
- format_tools = new FormatTools(mwindow,
- this,
- record->default_asset);
-//printf("RecordWindow::create_objects 1\n");
- format_tools->create_objects(x,
- y,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
+ format_tools = new FormatTools(mwindow, this, record->default_asset);
+ format_tools->create_objects(x, y, 1, 1, 1, 1, 1, 1,
/* record->fixed_compression */ 0,
- 1,
- 0,
- 0);
-//printf("RecordWindow::create_objects 1\n");
+ 1, 0, 0);
// Not the same as creating a new file at each label.
// Load mode is now located in the RecordGUI
// loadmode->create_objects();
add_subwindow(new BC_OKButton(this));
-//printf("RecordWindow::create_objects 1\n");
add_subwindow(new BC_CancelButton(this));
-//printf("RecordWindow::create_objects 1\n");
show_window();
+ unlock_window();
}
-
-
-
-
-
RecordToTracks::RecordToTracks(Record *record, int default_)
: BC_CheckBox(200, 270, default_) { this->record = record; }
RecordToTracks::~RecordToTracks()
ReIndexWindow::create_objects()
{
+ lock_window("ReIndexWindow::create_objects");
BC_SubWindow *subwindow;
add_subwindow(subwindow = new BC_SubWindow(0, 0, w, h, MEGREY));
subwindow->add_subwindow(new BC_Title(5, 5, _("Redraw all indexes for the current project?")));
subwindow->add_subwindow(ok = new ReIndexOkButton(this));
subwindow->add_subwindow(cancel = new ReIndexCancelButton(this));
+ unlock_window();
}
ReIndexOkButton::ReIndexOkButton(ReIndexWindow *window)
void ResizeVTrackWindow::create_objects()
{
- int x = 10, y = 10;
-
lock_window("ResizeVTrackWindow::create_objects");
+ int x = 10, y = 10;
BC_Title *size_title = new BC_Title(x, y, _("Size:"));
add_subwindow(size_title);
int x1 = x + size_title->get_w();
void ScaleWindow::create_objects()
{
+ lock_window("ScaleWindow::create_objects");
int x = 10, y = 10;
add_subwindow(new BC_Title(x, y, _("New camera size:")));
add_subwindow(new BC_Title(x + 200, y, _("New projector size:")));
add_subwindow(new BC_OKButton(x, y));
x += 200;
add_subwindow(new BC_CancelButton(x, y));
+ unlock_window();
}
ScaleSizeText::ScaleSizeText(int x, int y, ScaleThread *thread, int *output)
void SetFormatWindow::create_objects()
{
+ lock_window("SetFormatWindow::create_objects");
int x = 10, y = mwindow->theme->setformat_y1;
BC_TextBox *textbox;
BC_Title *title;
-
- lock_window("SetFormatWindow::create_objects");
mwindow->theme->draw_setformat_bg(this);
-
-
presets = new SetFormatPresets(mwindow, this, x, y);
presets->create_objects();
x = presets->x; // y = presets->y;
void ShBtnTextWindow::create_objects()
{
+ lock_window("ShBtnTextWindow::create_objects");
int x = 10, y = 10;
int x1 = 160;
BC_Title *title = new BC_Title(x, y, _("Label:"));
y = get_h() - ShBtnTextOK::calculate_h() - 10;
add_subwindow(new ShBtnTextOK(this, x, y));
show_window();
+ unlock_window();
}
ShBtnTextOK::ShBtnTextOK(ShBtnTextWindow *st_window, int x, int y)
void ShBtnEditWindow::create_objects()
{
+ lock_window("ShBtnEditWindow::create_objects");
Preferences *preferences = shbtn_edit->pwindow->thread->preferences;
for( int i=0; i<preferences->shbtn_prefs.size(); ++i ) {
shbtn_items.append(new ShBtnPrefItem(preferences->shbtn_prefs[i]));
add_subwindow(edit_button = new ShBtnEditButton(this, x, y));
add_subwindow(new BC_OKButton(this));
show_window();
+ unlock_window();
}
int ShBtnEditWindow::start_edit(ShBtnPref *pref)
SplashGUI::SplashGUI(VFrame *bg, int x, int y)
- : BC_Window(_(PROGRAM_NAME ": Loading"),
- x,
- y,
- bg->get_w(),
- bg->get_h(),
- -1,
- -1,
- 0,
- 0,
- 1,
- -1,
- "",
- 0)
+ : BC_Window(_(PROGRAM_NAME ": Loading"), x, y, bg->get_w(), bg->get_h(),
+ -1, -1, 0, 0, 1, -1, "", 0)
{
this->bg = bg;
}
void SplashGUI::create_objects()
{
+ lock_window("SplashGUI::create_objects");
draw_vframe(bg, 0, 0);
flash();
show_window();
- add_subwindow(operation =
- new BC_Title(5,
+ operation = new BC_Title(5,
get_h() - get_text_height(MEDIUMFONT) - 5,
- _("Loading...")));
+ _("Loading..."));
+ add_subwindow(operation);
+ unlock_window();
}
+void SplashGUI::update_status(const char *text)
+{
+ lock_window("SplashGUI::update_status");
+ operation->update(text);
+ unlock_window();
+}
SplashGUI(VFrame *bg, int x, int y);
~SplashGUI();
void create_objects();
+ void update_status(const char *text);
BC_Title *operation;
VFrame *bg;
};
void SWindowGUI::create_objects()
{
+ lock_window("SWindowGUI::create_objects");
int x = 10, y = 10;
BC_Title *title = new BC_Title(x, y, _("Path:"));
add_subwindow(title);
add_subwindow(ok);
cancel = new SWindowCancel(this, cancel_x, cancel_y);
add_subwindow(cancel);
+ unlock_window();
}
void SWindowGUI::load()
edithandleout_data = 0;
extract_data = 0;
ffmpeg_toggle = 0;
- proxy_toggle = 0;
+ proxy_s_toggle = 0;
+ proxy_p_toggle = 0;
infoasset_data = 0;
in_point = 0;
insert_data = 0;
{
mbuttons_x = 0;
mbuttons_y = gui->menu_h() + 1;
- mbuttons_w = w - (ffmpeg_toggle[0]->get_w()+2 + proxy_toggle[0]->get_w()+2);
+ mbuttons_w = w - (ffmpeg_toggle[0]->get_w()+2 + proxy_p_toggle[0]->get_w()+2);
mbuttons_h = get_image("mbutton_bg")->get_h();
mclock_x = window_border - 5;
mclock_y = mbuttons_y - 1 + mbuttons_h;
VFrame **edithandleout_data;
VFrame **extract_data;
VFrame **ffmpeg_toggle;
- VFrame **proxy_toggle;
+ VFrame **proxy_p_toggle;
+ VFrame **proxy_s_toggle;
VFrame **infoasset_data;
VFrame **in_point;
VFrame **insert_data;
void TipWindowGUI::create_objects()
{
+ lock_window("TipWindowGUI::create_objects");
int x = 10, y = 10;
add_subwindow(tip_text = new BC_Title(x, y, thread->get_current_tip(0)));
y = get_h() - 30;
show_window();
raise_window();
+ unlock_window();
}
int TipWindowGUI::keypress_event()
VideoWindowGUI::VideoWindowGUI(VideoWindow *thread, int w, int h)
: BC_Window(_(PROGRAM_NAME ": Video out"),
- (int)BC_INFINITY,
- (int)BC_INFINITY,
- w,
- h,
- 10,
- 10,
- 1,
- 1,
- 1)
+ (int)BC_INFINITY, (int)BC_INFINITY,
+ w, h, 10, 10, 1, 1, 1)
{
this->thread = thread;
}
void VideoWindowGUI::create_objects()
{
+ lock_window("VideoWindowGUI::create_objects");
add_subwindow(canvas = new VideoWindowCanvas(this, get_w(), get_h()));
update_title();
+ unlock_window();
}
-
int VideoWindowGUI::keypress_event()
{
}
void VWindowGUI::create_objects()
{
+ lock_window("VWindowGUI::create_objects");
in_point = 0;
out_point = 0;
- lock_window("VWindowGUI::create_objects");
set_icon(mwindow->theme->get_image("vwindow_icon"));
//printf("VWindowGUI::create_objects 1\n");
void WWindowGUI::create_objects()
{
+ lock_window("WWindowGUI::create_objects");
int x = 10, y = 10;
add_subwindow(new BC_TextBox(x, y, get_w()-50, 3, thread->warn_text));
y = get_h() - 30;
x = get_w() - BC_CancelButton::calculate_w() - 10;
add_subwindow(new BC_CancelButton(x, y));
show_window();
+ unlock_window();
}
WDisable::WDisable(WWindowGUI *gui, int x, int y)
CHECK_WITH([browser],[cin_browser path],[CIN_BROWSER],[firefox])
CHECK_WITH([git-ffmpeg],[git ffmpeg using url],[GIT_FFMPEG],[no])
CHECK_WITH([noelision],[use noelision/libpthread],[NOELISION],[auto])
+CHECK_WITH([booby],[window lock trace booby trap],[BOOBY],[no])
CHECK_WITH([libzmpeg],[build libzmpeg],[LIBZMPEG],[yes])
CHECK_WITH([commercial],[enable commercial capture],[COMMERCIAL],[yes])
CHECK_WITH([thirdparty],[use thirdparty build],[CIN_3RDPARTY],[yes])
echo " using: with-opencv = $WANT_OPENCV"
echo " using: with-git-ffmpeg = $WANT_GIT_FFMPEG"
echo " using: with-noelision = $WANT_NOELISION"
+echo " using: with-booby = $WANT_BOOBY"
echo " using: with-libzmpeg = $WANT_LIBZMPEG"
echo " using: with-commerical = $WANT_COMMERCIAL"
echo ""
CFG_CFLAGS+=' -I/usr/include/opus -I/usr/local/include/opus'
fi
fi
+if test "x$WANT_BOOBY" != "xno"; then
+ CFG_CFLAGS+=" -DBOOBY"
+fi
# intel lock elision bugs
if test "x$WANT_NOELISION" != "xno"; then
void BC_FileBox::create_objects()
{
+ lock_window("BC_FileBox::create_objects");
int x = 10, y = 10;
BC_Resources *resources = BC_WindowBase::get_resources();
int directory_title_margin = MAX(20,
refresh();
show_window();
+ unlock_window();
}
int BC_FileBox::get_listbox_w()
void BC_NewFolder::create_objects()
{
+ lock_window("BC_NewFolder::create_objects");
int x = 10, y = 10;
add_tool(new BC_Title(x, y, _("Enter the name of the folder:")));
y += 20;
x = get_w() - 100;
add_subwindow(new BC_CancelButton(this));
show_window();
+ unlock_window();
}
const char* BC_NewFolder::get_text()
int BC_ProgressWindow::create_objects(const char *text, int64_t length)
{
int x = 10, y = 10;
-
+ lock_window("BC_ProgressWindow::create_objects");
// Recalculate width based on text
if(text)
{
add_tool(bar = new BC_ProgressBar(x, y, get_w() - 20, length));
add_tool(new BC_CancelButton(this));
show_window(1);
-
+ unlock_window();
return 0;
}
#include "bctrace.h"
+#ifdef BOOBY
+#include <execinfo.h>
+#define BT_BUF_SIZE 100
+// booby trap (backtrace)
+void booby() {
+ printf("BOOBY!\n");
+ void *buffer[BT_BUF_SIZE];
+ int nptrs = backtrace(buffer, BT_BUF_SIZE);
+ char **trace = backtrace_symbols(buffer, nptrs);
+ if( !trace ) return;
+ for( int i=0; i<nptrs; ) printf("%s\n", trace[i++]);
+ free(trace);
+}
+#endif
+
BC_Trace *BC_Trace::global_trace = 0;
int trace_memory = 0;
int trace_locks = 1;
#include "cstrdup.h"
#include <pthread.h>
+#ifdef BOOBY
+#define BT if( top_level->display_lock_owner != pthread_self() ) booby();
+void booby();
+#else
+#define BT
+#endif
class BC_Trace
{
#endif
id = get_resources()->get_id();
- int need_lock = 0;
if(parent_window) top_level = parent_window->top_level;
- if( top_level ) { // need this to avoid deadlock with Xlib's locks
- need_lock = 1;
- lock_window("BC_WindowBase::create_window");
- }
+ if( top_level ) lock_window("BC_WindowBase::create_window");
get_resources()->create_window_lock->lock("BC_WindowBase::create_window");
#ifdef HAVE_LIBXXF86VM
if( shm_completion_event < 0 ) shm_completion_event =
ShmCompletion + XShmGetEventBase(display);
#endif
+ lock_window("BC_WindowBase::create_window 1");
screen = DefaultScreen(display);
rootwin = RootWindow(display, screen);
if(!hidden) show_window();
}
get_resources()->create_window_lock->unlock();
- if(need_lock) unlock_window();
+ unlock_window();
return 0;
}
#include "bcwindowbase.h"
#include "clip.h"
#include "bccolors.h"
+#include "bctrace.h"
#include "cursors.h"
#include "fonts.h"
#include "vframe.h"
#include "workarounds.h"
void BC_WindowBase::copy_area(int x1, int y1, int x2, int y2, int w, int h, BC_Pixmap *pixmap)
-{
+{ BT
XCopyArea(top_level->display,
pixmap ? pixmap->opaque_pixmap : this->pixmap->opaque_pixmap,
pixmap ? pixmap->opaque_pixmap : this->pixmap->opaque_pixmap,
void BC_WindowBase::draw_box(int x, int y, int w, int h, BC_Pixmap *pixmap)
-{
+{ BT
//if(x == 0) printf("BC_WindowBase::draw_box %d %d %d %d\n", x, y, w, h);
XFillRectangle(top_level->display,
pixmap ? pixmap->opaque_pixmap : this->pixmap->opaque_pixmap,
void BC_WindowBase::draw_circle(int x, int y, int w, int h, BC_Pixmap *pixmap)
-{
+{ BT
XDrawArc(top_level->display,
pixmap ? pixmap->opaque_pixmap : this->pixmap->opaque_pixmap,
top_level->gc, x, y, (w - 1), (h - 2), 0 * 64, 360 * 64);
void BC_WindowBase::draw_arc(int x, int y, int w, int h,
int start_angle, int angle_length, BC_Pixmap *pixmap)
-{
+{ BT
XDrawArc(top_level->display,
pixmap ? pixmap->opaque_pixmap : this->pixmap->opaque_pixmap,
top_level->gc, x, y, (w - 1), (h - 2), start_angle * 64,
}
void BC_WindowBase::draw_disc(int x, int y, int w, int h, BC_Pixmap *pixmap)
-{
+{ BT
XFillArc(top_level->display,
pixmap ? pixmap->opaque_pixmap : this->pixmap->opaque_pixmap,
top_level->gc, x, y, (w - 1), (h - 2), 0 * 64, 360 * 64);
}
void BC_WindowBase::clear_box(int x, int y, int w, int h, BC_Pixmap *pixmap)
-{
+{ BT
set_color(bg_color);
Pixmap xpixmap = pixmap ? pixmap->opaque_pixmap : this->pixmap->opaque_pixmap;
XFillRectangle(top_level->display, xpixmap, top_level->gc, x, y, w, h);
return;
}
#endif
+ BT
Pixmap xpixmap = pixmap ? pixmap->opaque_pixmap : this->pixmap->opaque_pixmap;
if( get_resources()->use_fontset ) {
XFontSet fontset = top_level->get_curr_fontset();
draw_xft_text(x, y, text, length, pixmap);
return;
}
-
+ BT
for(int i = 0, j = 0; i <= length; i++) {
if(text[i] == '\n' || text[i] == 0) {
if(get_resources()->use_fontset && top_level->get_curr_fontset()) {
1);
return;
}
-
+ BT
for(int i = 0, j = 0; i <= length; i++)
{
if(text[i] == '\n' || text[i] == 0)
void BC_WindowBase::xft_draw_string(XftColor *xft_color, XftFont *xft_font,
int x, int y, const FcChar32 *fc, int len, BC_Pixmap *pixmap)
-{
+{ BT
Pixmap draw_pixmap = 0;
XftDraw *xft_draw = (XftDraw *)
(pixmap ? pixmap->opaque_xft_draw : this->pixmap->opaque_xft_draw);
if( !length ) return 0;
if( !get_resources()->use_xft ) {
+ BT
if( !get_font_struct(font) ) return 0;
XChar2b xtext[length], *xp = xtext;
for( int i=0; i<length; ++i,++xp ) {
}
void BC_WindowBase::draw_line(int x1, int y1, int x2, int y2, BC_Pixmap *pixmap)
-{
+{ BT
// Some X drivers can't draw 0 length lines
if(x1 == x2 && y1 == y2)
{
}
void BC_WindowBase::draw_polygon(ArrayList<int> *x, ArrayList<int> *y, BC_Pixmap *pixmap)
-{
+{ BT
int npoints = MIN(x->total, y->total);
XPoint *points = new XPoint[npoints];
}
void BC_WindowBase::fill_polygon(ArrayList<int> *x, ArrayList<int> *y, BC_Pixmap *pixmap)
-{
+{ BT
int npoints = MIN(x->total, y->total);
XPoint *points = new XPoint[npoints];
void BC_WindowBase::draw_rectangle(int x, int y, int w, int h)
-{
+{ BT
XDrawRectangle(top_level->display,
pixmap->opaque_pixmap,
top_level->gc,
}
void BC_WindowBase::draw_triangle_down_flat(int x, int y, int w, int h)
-{
+{ BT
int x1, y1, x2, y2, x3;
XPoint point[3];
void BC_WindowBase::draw_triangle_up(int x, int y, int w, int h,
int light1, int light2, int middle, int shadow1, int shadow2)
-{
+{ BT
int x1, y1, x2, y2, x3;
XPoint point[3];
void BC_WindowBase::draw_triangle_left(int x, int y, int w, int h,
int light1, int light2, int middle, int shadow1, int shadow2)
-{
+{ BT
int x1, y1, x2, y2, y3;
XPoint point[3];
void BC_WindowBase::draw_triangle_right(int x, int y, int w, int h,
int light1, int light2, int middle, int shadow1, int shadow2)
-{
+{ BT
int x1, y1, x2, y2, y3;
XPoint point[3];
}
void BC_WindowBase::draw_tiles(BC_Pixmap *tile, int origin_x, int origin_y, int x, int y, int w, int h)
-{
+{ BT
if(!tile)
{
set_color(bg_color);
}
void BC_WindowBase::draw_top_tiles(BC_WindowBase *parent_window, int x, int y, int w, int h)
-{
+{ BT
Window tempwin;
int origin_x, origin_y;
XTranslateCoordinates(top_level->display,
int w,
int h,
BC_Pixmap *pixmap)
-{
+{ BT
Window tempwin;
int top_x, top_y;
XLockDisplay(top_level->display);
int src_w,
int src_h,
BC_Pixmap *pixmap)
-{
-
+{ BT
// Hide cursor if video enabled
update_video_cursor();
void BC_WindowBase::draw_pixel(int x, int y, BC_Pixmap *pixmap)
-{
+{ BT
XDrawPoint(top_level->display,
pixmap ? pixmap->opaque_pixmap : this->pixmap->opaque_pixmap,
top_level->gc,
int src_x,
int src_y,
BC_Pixmap *dst)
-{
+{ BT
pixmap->write_drawable(dst ? dst->opaque_pixmap : this->pixmap->opaque_pixmap,
dest_x,
dest_y,
}
void BC_WindowBase::slide_left(int distance)
-{
+{ BT
if(distance < w)
{
XCopyArea(top_level->display,
}
void BC_WindowBase::slide_right(int distance)
-{
+{ BT
if(distance < w)
{
XCopyArea(top_level->display,
}
void BC_WindowBase::slide_up(int distance)
-{
+{ BT
if(distance < h)
{
XCopyArea(top_level->display,
}
void BC_WindowBase::slide_down(int distance)
-{
+{ BT
if(distance < h)
{
XCopyArea(top_level->display,
{
}
-int ErrorBox::create_objects(const char *text)
+void ErrorBox::create_objects(const char *text)
{
+ lock_window("ErrorBox::create_objects");
int x = 10, y = 10;
add_subwindow(new BC_Title(get_w() / 2,
y = get_h() - 50;
add_tool(new BC_OKButton(x, y));
show_window(1);
- return 0;
+ unlock_window();
}
int h = 120);
virtual ~ErrorBox();
- int create_objects(const char *text);
+ void create_objects(const char *text);
};
#endif
if(config_consume!=config_produce)
flush_config_change();
}
+ if(!plugin->server->plugin) return 0;
if(!plugin->server->plugin->on) return 0;
if(d==207){
"ff_down.png",
"ff_checkedhi.png");
- proxy_toggle = new_image_set(5,
- "proxy_up.png",
- "proxy_hi.png",
- "proxy_chkd.png",
- "proxy_down.png",
- "proxy_chkdhi.png");
+ proxy_p_toggle = new_image_set(5,
+ "proxy_p_up.png",
+ "proxy_p_hi.png",
+ "proxy_p_chkd.png",
+ "proxy_p_down.png",
+ "proxy_p_chkdhi.png");
+
+ proxy_s_toggle = new_image_set(5,
+ "proxy_s_up.png",
+ "proxy_s_hi.png",
+ "proxy_s_chkd.png",
+ "proxy_s_down.png",
+ "proxy_s_chkdhi.png");
shbtn_data = new_image_set(3,
"shbtn_up.png",
"ff_down.png",
"ff_checkedhi.png");
- proxy_toggle = new_image_set(5,
- "proxy_up.png",
- "proxy_hi.png",
- "proxy_chkd.png",
- "proxy_down.png",
- "proxy_chkdhi.png");
+ proxy_p_toggle = new_image_set(5,
+ "proxy_p_up.png",
+ "proxy_p_hi.png",
+ "proxy_p_chkd.png",
+ "proxy_p_down.png",
+ "proxy_p_chkdhi.png");
+
+ proxy_s_toggle = new_image_set(5,
+ "proxy_s_up.png",
+ "proxy_s_hi.png",
+ "proxy_s_chkd.png",
+ "proxy_s_down.png",
+ "proxy_s_chkdhi.png");
shbtn_data = new_image_set(3,
"shbtn_up.png",
{
mbuttons_x = 0;
mbuttons_y = gui->mainmenu->get_h();
- mbuttons_w = w - (ffmpeg_toggle[0]->get_w()+2 + proxy_toggle[0]->get_w()+2);
+ mbuttons_w = w - (ffmpeg_toggle[0]->get_w()+2 + proxy_p_toggle[0]->get_w()+2);
mbuttons_h = get_image("mbutton_bg")->get_h();
mclock_x = 10;
mclock_y = mbuttons_y + mbuttons_h + CWINDOW_METER_MARGIN;
"ff_down.png",
"ff_checkedhi.png");
- proxy_toggle = new_image_set(5,
- "proxy_up.png",
- "proxy_hi.png",
- "proxy_chkd.png",
- "proxy_down.png",
- "proxy_chkdhi.png");
+ proxy_p_toggle = new_image_set(5,
+ "proxy_p_up.png",
+ "proxy_p_hi.png",
+ "proxy_p_chkd.png",
+ "proxy_p_down.png",
+ "proxy_p_chkdhi.png");
+
+ proxy_s_toggle = new_image_set(5,
+ "proxy_s_up.png",
+ "proxy_s_hi.png",
+ "proxy_s_chkd.png",
+ "proxy_s_down.png",
+ "proxy_s_chkdhi.png");
shbtn_data = new_image_set(3,
"shbtn_up.png",
"ff_down.png",
"ff_checkedhi.png");
- proxy_toggle = new_image_set(5,
- "proxy_up.png",
- "proxy_hi.png",
- "proxy_chkd.png",
- "proxy_down.png",
- "proxy_chkdhi.png");
+ proxy_p_toggle = new_image_set(5,
+ "proxy_p_up.png",
+ "proxy_p_hi.png",
+ "proxy_p_chkd.png",
+ "proxy_p_down.png",
+ "proxy_p_chkdhi.png");
+
+ proxy_s_toggle = new_image_set(5,
+ "proxy_s_up.png",
+ "proxy_s_hi.png",
+ "proxy_s_chkd.png",
+ "proxy_s_down.png",
+ "proxy_s_chkdhi.png");
shbtn_data = new_image_set(3,
"shbtn_up.png",
// Position of menu buttons (start, stop, ff, etc.)
mbuttons_x = 0;
mbuttons_y = gui->mainmenu->get_h();
- mbuttons_w = w - (ffmpeg_toggle[0]->get_w()+2 + proxy_toggle[0]->get_w()+2);
+ mbuttons_w = w - (ffmpeg_toggle[0]->get_w()+2 + proxy_p_toggle[0]->get_w()+2);
mbuttons_h = get_image("mbutton_left")->get_h();
mclock_x = 20; //x position of digits in clock window
mclock_y = mbuttons_y + 1 + mbuttons_h + CWINDOW_METER_MARGIN;
"ff_down.png",
"ff_checkedhi.png");
- proxy_toggle = new_image_set(5,
- "proxy_up.png",
- "proxy_hi.png",
- "proxy_chkd.png",
- "proxy_down.png",
- "proxy_chkdhi.png");
+ proxy_p_toggle = new_image_set(5,
+ "proxy_p_up.png",
+ "proxy_p_hi.png",
+ "proxy_p_chkd.png",
+ "proxy_p_down.png",
+ "proxy_p_chkdhi.png");
+
+ proxy_s_toggle = new_image_set(5,
+ "proxy_s_up.png",
+ "proxy_s_hi.png",
+ "proxy_s_chkd.png",
+ "proxy_s_down.png",
+ "proxy_s_chkdhi.png");
shbtn_data = new_image_set(3,
"shbtn_up.png",
"ff_down.png",
"ff_checkedhi.png");
- proxy_toggle = new_image_set(5,
- "proxy_up.png",
- "proxy_hi.png",
- "proxy_chkd.png",
- "proxy_down.png",
- "proxy_chkdhi.png");
+ proxy_p_toggle = new_image_set(5,
+ "proxy_p_up.png",
+ "proxy_p_hi.png",
+ "proxy_p_chkd.png",
+ "proxy_p_down.png",
+ "proxy_p_chkdhi.png");
+
+ proxy_s_toggle = new_image_set(5,
+ "proxy_s_up.png",
+ "proxy_s_hi.png",
+ "proxy_s_chkd.png",
+ "proxy_s_down.png",
+ "proxy_s_chkdhi.png");
shbtn_data = new_image_set(3,
"shbtn_up.png",
"ff_down.png",
"ff_checkedhi.png");
- proxy_toggle = new_image_set(5,
- "proxy_up.png",
- "proxy_hi.png",
- "proxy_chkd.png",
- "proxy_down.png",
- "proxy_chkdhi.png");
+ proxy_p_toggle = new_image_set(5,
+ "proxy_p_up.png",
+ "proxy_p_hi.png",
+ "proxy_p_chkd.png",
+ "proxy_p_down.png",
+ "proxy_p_chkdhi.png");
+
+ proxy_s_toggle = new_image_set(5,
+ "proxy_s_up.png",
+ "proxy_s_hi.png",
+ "proxy_s_chkd.png",
+ "proxy_s_down.png",
+ "proxy_s_chkdhi.png");
shbtn_data = new_image_set(3,
"shbtn_up.png",
"ff_down.png",
"ff_checkedhi.png");
- proxy_toggle = new_image_set(5,
- "proxy_up.png",
- "proxy_hi.png",
- "proxy_chkd.png",
- "proxy_down.png",
- "proxy_chkdhi.png");
+ proxy_p_toggle = new_image_set(5,
+ "proxy_p_up.png",
+ "proxy_p_hi.png",
+ "proxy_p_chkd.png",
+ "proxy_p_down.png",
+ "proxy_p_chkdhi.png");
+
+ proxy_s_toggle = new_image_set(5,
+ "proxy_s_up.png",
+ "proxy_s_hi.png",
+ "proxy_s_chkd.png",
+ "proxy_s_down.png",
+ "proxy_s_chkdhi.png");
shbtn_data = new_image_set(3,
"shbtn_up.png",
"ff_down.png",
"ff_checkedhi.png");
- proxy_toggle = new_image_set(5,
- "proxy_up.png",
- "proxy_hi.png",
- "proxy_chkd.png",
- "proxy_down.png",
- "proxy_chkdhi.png");
+ proxy_p_toggle = new_image_set(5,
+ "proxy_p_up.png",
+ "proxy_p_hi.png",
+ "proxy_p_chkd.png",
+ "proxy_p_down.png",
+ "proxy_p_chkdhi.png");
+
+ proxy_s_toggle = new_image_set(5,
+ "proxy_s_up.png",
+ "proxy_s_hi.png",
+ "proxy_s_chkd.png",
+ "proxy_s_down.png",
+ "proxy_s_chkdhi.png");
shbtn_data = new_image_set(3,
"shbtn_up.png",