ac3_bitrate = 128;
png_use_alpha = 0;
+
exr_use_alpha = 0;
exr_compression = 0;
}
-void AssetEdit::edit_asset(Indexable *indexable)
+void AssetEdit::edit_asset(Indexable *indexable, int x, int y)
{
close_window();
this->indexable = indexable;
this->indexable->add_user();
+ this->x = x; this->y = y;
// Copy asset parameters into temporary storage for editing.
- if(indexable->is_asset)
- {
+ if( indexable->is_asset ) {
changed_params->copy_from((Asset*)indexable, 0);
}
- else
- {
+ else {
EDL *nested_edl = (EDL*)indexable;
-
- strcpy(changed_params->path, nested_edl->path);
+ strcpy(changed_params->path, nested_edl->path);
changed_params->sample_rate = nested_edl->session->sample_rate;
changed_params->channels = nested_edl->session->audio_channels;
void AssetEdit::handle_close_event(int result)
{
- if(!result) {
+ if( !result ) {
int changed = 0;
Asset *asset = 0;
EDL *nested_edl = 0;
- if(indexable->is_asset) {
+ if( indexable->is_asset ) {
asset = (Asset*)indexable;
if( !changed_params->equivalent(*asset, 1, 1, mwindow->edl) )
changed = 1;
else {
nested_edl = (EDL*)indexable;
if( strcmp(changed_params->path, nested_edl->path)
-// || changed_params->sample_rate != nested_edl->session->sample_rate
-// || !EQUIV(changed_params->frame_rate, nested_edl->session->frame_rate
+// || changed_params->sample_rate != nested_edl->session->sample_rate
+// || !EQUIV(changed_params->frame_rate, nested_edl->session->frame_rate
)
changed = 1;
}
- if(changed) {
+ if( changed ) {
mwindow->gui->lock_window();
//printf("AssetEdit::handle_close_event %d\n", __LINE__);
// Omit index status from copy since an index rebuild may have been
// happening when new_asset was created but not be happening anymore.
- if(asset) {
+ if( asset ) {
mwindow->remove_asset_from_caches(asset);
//printf("AssetEdit::handle_close_event %d %f\n", __LINE__, asset->get_frame_rate());
asset->copy_from(changed_params, 0);
else {
strcpy(nested_edl->path, changed_params->path);
// Other parameters can't be changed because they're defined in the other EDL
-// nested_edl->session->frame_rate = changed_params->frame_rate;
-// nested_edl->session->sample_rate = changed_params->sample_rate;
+// nested_edl->session->frame_rate = changed_params->frame_rate;
+// nested_edl->session->sample_rate = changed_params->sample_rate;
}
//printf("AssetEdit::handle_close_event %d\n", __LINE__);
AssetEditWindow::AssetEditWindow(MWindow *mwindow, AssetEdit *asset_edit)
: BC_Window(_(PROGRAM_NAME ": Asset Info"),
- mwindow->gui->get_abs_cursor_x(1) - 400 / 2,
- mwindow->gui->get_abs_cursor_y(1) - asset_edit->window_height() / 2,
+ asset_edit->x - 450/2, asset_edit->y - asset_edit->window_height()/2,
450, asset_edit->window_height(), 0, 0, 1)
{
this->mwindow = mwindow;
hilo = 0;
lohi = 0;
allow_edits = 0;
- detail_thread = 0;
+ detail_dialog = 0;
win_width = 0;
win_height = 0;
}
AssetEditWindow::~AssetEditWindow()
{
lock_window("AssetEditWindow::~AssetEditWindow");
- if(bitspopup) delete bitspopup;
- if(detail_thread) delete detail_thread;
+ delete bitspopup;
+ delete detail_dialog;
unlock_window();
}
Asset *asset = 0;
EDL *nested_edl = 0;
- if(asset_edit->indexable->is_asset)
+ if( asset_edit->indexable->is_asset )
asset = (Asset*)asset_edit->indexable;
else
nested_edl = (EDL*)asset_edit->indexable;
- if(asset && asset->format == FILE_PCM)
+ if( asset && asset->format == FILE_PCM )
allow_edits = 1;
else
allow_edits = 0;
lock_window("AssetEditWindow::create_objects");
- if(allow_edits)
+ if( allow_edits )
vmargin = 30;
else
vmargin = 20;
add_subwindow(path_text = new AssetEditPathText(this, y));
- add_subwindow(path_button = new AssetEditPath(mwindow,
- this,
- path_text,
- y,
- asset_edit->indexable->path,
- _(PROGRAM_NAME ": Asset path"), _("Select a file for this asset:")));
+ add_subwindow(path_button = new AssetEditPath(mwindow, this,
+ path_text, y, asset_edit->indexable->path,
+ _(PROGRAM_NAME ": Asset path"),
+ _("Select a file for this asset:")));
y += 30;
- if(asset)
- {
+ if( asset ) {
add_subwindow(new BC_Title(x, y, _("File format:")));
x = x2;
add_subwindow(new BC_Title(x, y, File::formattostr(mwindow->plugindb,
add_subwindow(new BC_Title(x2, y, string, MEDIUMFONT, mwindow->theme->assetedit_color));
- if(asset->format == FILE_MPEG || asset->format == FILE_FFMPEG)
- {
- detail_thread = new DetailAssetThread(mwindow);
+ if( asset->format == FILE_MPEG || asset->format == FILE_FFMPEG ) {
+ detail_dialog = new DetailAssetDialog(mwindow);
BC_GenericButton *detail = new DetailAssetButton(this, x2+120, y);
add_subwindow(detail);
}
y += 20;
x = x1;
- if(asset->audio_length > 0)
+ if( asset->audio_length > 0 )
length = (double)asset->audio_length / asset->sample_rate;
- if(asset->video_length > 0)
+ if( asset->video_length > 0 )
length = MAX(length, (double)asset->video_length / asset->frame_rate);
int64_t bitrate;
- if(!EQUIV(length, 0))
+ if( !EQUIV(length, 0) )
bitrate = (int64_t)(bytes * 8 / length);
else
bitrate = bytes;
x = x1;
}
- if((asset && asset->audio_data) || nested_edl)
- {
+ if( (asset && asset->audio_data) || nested_edl ) {
add_subwindow(new BC_Bar(x, y, get_w() - x * 2));
y += 5;
y += 30;
- if(asset)
- {
- if(asset->get_compression_text(1, 0))
- {
+ if( asset ) {
+ if( asset->get_compression_text(1, 0) ) {
add_subwindow(new BC_Title(x, y, _("Compression:")));
x = x2;
add_subwindow(new BC_Title(x,
sprintf(string, "%d", asset_edit->changed_params->channels);
x = x2;
- if(allow_edits)
- {
+ if( allow_edits ) {
BC_TumbleTextBox *textbox = new AssetEditChannels(this,
string,
x,
textbox->create_objects();
y += vmargin;
}
- else
- {
+ else {
add_subwindow(new BC_Title(x, y, string, MEDIUMFONT, mwindow->theme->assetedit_color));
y += 20;
}
sprintf(string, "%d", asset_edit->changed_params->sample_rate);
x = x2;
- if(asset)
- {
+ if( asset ) {
BC_TextBox *textbox;
add_subwindow(textbox = new AssetEditRate(this, string, x, y));
x += textbox->get_w();
add_subwindow(new SampleRatePulldown(mwindow, textbox, x, y));
}
- else
- {
+ else {
add_subwindow(new BC_Title(x, y, string, MEDIUMFONT, mwindow->theme->assetedit_color));
}
y += 30;
x = x1;
- if(asset)
- {
+ if( asset ) {
add_subwindow(new BC_Title(x, y, _("Bits:")));
x = x2;
- if(allow_edits)
- {
- bitspopup = new BitsPopup(this,
- x,
- y,
+ if( allow_edits ) {
+ bitspopup = new BitsPopup(this, x, y,
&asset_edit->changed_params->bits,
- 1,
- 1,
- 1,
- 0,
- 1);
+ 1, 1, 1, 0, 1);
bitspopup->create_objects();
}
else
sprintf(string, "%d", asset->header);
x = x2;
- if(allow_edits)
+ if( allow_edits )
add_subwindow(new AssetEditHeader(this, string, x, y));
else
add_subwindow(new BC_Title(x, y, string, MEDIUMFONT, mwindow->theme->assetedit_color));
add_subwindow(new BC_Title(x, y, _("Byte order:")));
- if(allow_edits)
+ if( allow_edits )
{
x = x2;
y));
y += vmargin;
}
- else
- {
+ else {
x = x2;
- if(asset->byte_order)
+ if( asset->byte_order )
add_subwindow(new BC_Title(x, y, _("Lo-Hi"), MEDIUMFONT, mwindow->theme->assetedit_color));
else
add_subwindow(new BC_Title(x, y, _("Hi-Lo"), MEDIUMFONT, mwindow->theme->assetedit_color));
x = x1;
- if(allow_edits)
- {
+ if( allow_edits ) {
// add_subwindow(new BC_Title(x, y, _("Values are signed:")));
add_subwindow(new AssetEditSigned(this, asset->signed_, x, y));
}
- else
- {
- if(!asset->signed_ && asset->bits == 8)
+ else {
+ if( !asset->signed_ && asset->bits == 8 )
add_subwindow(new BC_Title(x, y, _("Values are unsigned")));
else
add_subwindow(new BC_Title(x, y, _("Values are signed")));
}
x = x1;
- if((asset && asset->video_data) || nested_edl)
- {
+ if( (asset && asset->video_data) || nested_edl ) {
add_subwindow(new BC_Bar(x, y, get_w() - x * 2));
y += 5;
x = x1;
- if(asset && asset->get_compression_text(0,1))
- {
+ if( asset && asset->get_compression_text(0,1) ) {
add_subwindow(new BC_Title(x, y, _("Compression:")));
x = x2;
add_subwindow(new BC_Title(x,
sprintf(string, "%.4f", asset_edit->changed_params->frame_rate);
//printf("AssetEditWindow::create_objects %d %f\n", __LINE__, asset_edit->changed_params->frame_rate);
- if(asset)
- {
+ if( asset ) {
BC_TextBox *framerate;
add_subwindow(framerate = new AssetEditFRate(this, string, x, y));
x += 105;
add_subwindow(new FrameRatePulldown(mwindow, framerate, x, y));
}
- else
- {
+ else {
add_subwindow(new BC_Title(x, y, string, MEDIUMFONT, mwindow->theme->assetedit_color));
}
add_subwindow(win_height);
y += win_height->get_h() + 5;
- if(asset && (asset->format == FILE_MPEG || asset->format == FILE_FFMPEG ) )
- {
+ if( asset && (asset->format == FILE_MPEG || asset->format == FILE_FFMPEG ) ) {
y += 5;
x = x1;
add_subwindow(new BC_Title(x, y, _("Actual width:")));
void AssetEditWindow::show_info_detail()
{
- detail_thread->start((Asset*)asset_edit->indexable);
+ int cur_x, cur_y;
+ get_abs_cursor_xy(cur_x, cur_y, 0);
+ detail_dialog->start((Asset*)asset_edit->indexable, cur_x, cur_y);
}
int thevalue = get_value();
Asset *asset = fwindow->asset_edit->changed_params;
- if (thevalue == ILACE_AUTOFIXOPTION_AUTO)
- {
- this->ilacemode_textbox->enable();
- this->ilacemode_listbox->enable();
- this->ilacefixmethod_textbox->disable();
- this->ilacefixmethod_listbox->disable();
- int xx = ilaceautofixmethod(mwindow->edl->session->interlace_mode,asset->interlace_mode);
- ilacefixmethod_to_text(string,xx);
- this->ilacefixmethod_textbox->update(string);
- }
- if (thevalue == ILACE_AUTOFIXOPTION_MANUAL)
- {
- this->ilacemode_textbox->disable();
- this->ilacemode_listbox->disable();
- this->ilacefixmethod_textbox->enable();
- this->ilacefixmethod_listbox->enable();
- ilacefixmethod_to_text(string,asset->interlace_fixmethod);
- this->ilacefixmethod_textbox->update(string);
+ if( thevalue == ILACE_AUTOFIXOPTION_AUTO ) {
+ this->ilacemode_textbox->enable();
+ this->ilacemode_listbox->enable();
+ this->ilacefixmethod_textbox->disable();
+ this->ilacefixmethod_listbox->disable();
+ int xx = ilaceautofixmethod(mwindow->edl->session->interlace_mode,asset->interlace_mode);
+ ilacefixmethod_to_text(string, xx);
+ this->ilacefixmethod_textbox->update(string);
+ }
+ if( thevalue == ILACE_AUTOFIXOPTION_MANUAL ) {
+ this->ilacemode_textbox->disable();
+ this->ilacemode_listbox->disable();
+ this->ilacefixmethod_textbox->enable();
+ this->ilacefixmethod_listbox->enable();
+ ilacefixmethod_to_text(string, asset->interlace_fixmethod);
+ this->ilacefixmethod_textbox->update(string);
}
}
DetailAssetButton::DetailAssetButton(AssetEditWindow *fwindow, int x, int y)
: BC_GenericButton(x, y, _("Detail"))
{
- this->fwindow = fwindow;
- set_underline(0);
+ this->fwindow = fwindow;
+ set_underline(0);
}
DetailAssetButton::~DetailAssetButton()
int DetailAssetButton::handle_event()
{
fwindow->show_info_detail();
- return 1;
+ return 1;
}
-DetailAssetWindow::DetailAssetWindow(MWindow *mwindow, Asset *asset)
+DetailAssetWindow::DetailAssetWindow(MWindow *mwindow,
+ DetailAssetDialog *detail_dialog, Asset *asset)
: BC_Window(_("Asset Detail"),
- mwindow->gui->get_abs_cursor_x(1) - 600/2,
- mwindow->gui->get_abs_cursor_y(1) - 500/2,
- 600, 500)
+ detail_dialog->x - 600/2, detail_dialog->y - 500/2, 600, 500)
{
this->mwindow = mwindow;
+ this->detail_dialog = detail_dialog;
this->asset = asset;
asset->add_user();
info[0] = 0;
delete text;
}
-DetailAssetThread::DetailAssetThread(MWindow *mwindow)
- : Thread(1, 0, 0)
+DetailAssetDialog::DetailAssetDialog(MWindow *mwindow)
+ : BC_DialogThread()
{
this->mwindow = mwindow;
dwindow = 0;
}
-DetailAssetThread::~DetailAssetThread()
-{
- stop();
-}
-
-void DetailAssetThread::stop()
+DetailAssetDialog::~DetailAssetDialog()
{
- if( Thread::running() ) {
- dwindow->lock_window("DetailAssetThread::stop");
- dwindow->set_done(1);
- dwindow->unlock_window();
- }
- Thread::join();
+ close_window();
}
void DetailAssetWindow::create_objects()
break;
}
}
- lock_window("DetailAssetThread::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 DetailAssetThread::start(Asset *asset)
+void DetailAssetDialog::start(Asset *asset, int x, int y)
{
- stop();
delete dwindow;
- dwindow = new DetailAssetWindow(mwindow, asset);
- Thread::start();
+ this->asset = asset;
+ this->x = x; this->y = y;
+ BC_DialogThread::start();
}
-void DetailAssetThread::run()
+BC_Window *DetailAssetDialog::new_gui()
{
-// Get length from TOC
+ dwindow = new DetailAssetWindow(mwindow, this, asset);
dwindow->create_objects();
- dwindow->run_window();
- delete dwindow;
- dwindow = 0;
+ return dwindow;
}
AssetEdit(MWindow *mwindow);
~AssetEdit();
- void edit_asset(Indexable *indexable);
+ void edit_asset(Indexable *indexable, int x, int y);
int set_asset(Indexable *indexable);
void handle_done_event(int result);
void handle_close_event(int result);
Indexable *indexable;
MWindow *mwindow;
AssetEditWindow *window;
-
+ int x, y;
// Changed parameters
Asset *changed_params;
AssetEdit *asset_edit;
BC_Title *win_width;
BC_Title *win_height;
- DetailAssetThread *detail_thread;
+ DetailAssetDialog *detail_dialog;
void show_info_detail();
};
class AssetEditChannels : public BC_TumbleTextBox
{
public:
- AssetEditChannels(AssetEditWindow *fwindow, char *text, int x, int y);
+ AssetEditChannels(AssetEditWindow *fwindow,
+ char *text, int x, int y);
int handle_event();
class AssetEditRate : public BC_TextBox
{
public:
- AssetEditRate(AssetEditWindow *fwindow, char *text, int x, int y);
+ AssetEditRate(AssetEditWindow *fwindow,
+ char *text, int x, int y);
int handle_event();
class AssetEditFRate : public BC_TextBox
{
public:
- AssetEditFRate(AssetEditWindow *fwindow, char *text, int x, int y);
+ AssetEditFRate(AssetEditWindow *fwindow,
+ char *text, int x, int y);
int handle_event();
class Interlaceautofix : public BC_CheckBox
{
public:
- Interlaceautofix(MWindow *mwindow,AssetEditWindow *fwindow, int x, int y);
+ Interlaceautofix(MWindow *mwindow, AssetEditWindow *fwindow,
+ int x, int y);
~Interlaceautofix();
int handle_event();
class AssetEditILaceautofixoption : public BC_TextBox
{
public:
- AssetEditILaceautofixoption(AssetEditWindow *fwindow, char *text, int thedefault, int x, int y, int w);
+ AssetEditILaceautofixoption(AssetEditWindow *fwindow,
+ char *text, int thedefault, int x, int y, int w);
int handle_event();
int thedefault;
class AssetEditILacemode : public BC_TextBox
{
public:
- AssetEditILacemode(AssetEditWindow *fwindow, const char *text, int thedefault, int x, int y, int w);
+ AssetEditILacemode(AssetEditWindow *fwindow,
+ const char *text, int thedefault, int x, int y, int w);
int handle_event();
int thedefault;
AssetEditWindow *fwindow;
{
public:
AssetEditInterlacemodePulldown(MWindow *mwindow,
- BC_TextBox *output_text,
- int *output_value,
- ArrayList<BC_ListBoxItem*> *data,
- Interlaceautofix *fixoption_chkbox,
- int x,
- int y);
+ BC_TextBox *output_text, int *output_value,
+ ArrayList<BC_ListBoxItem*> *data,
+ Interlaceautofix *fixoption_chkbox,
+ int x, int y);
int handle_event();
char* interlacemode_to_text();
MWindow *mwindow;
class AssetEditILacefixmethod : public BC_TextBox
{
public:
- AssetEditILacefixmethod(AssetEditWindow *fwindow, const char *text, int thedefault, int x, int y, int w);
+ AssetEditILacefixmethod(AssetEditWindow *fwindow,
+ const char *text, int thedefault, int x, int y, int w);
int handle_event();
int thedefault;
class AssetEditHeader : public BC_TextBox
{
public:
- AssetEditHeader(AssetEditWindow *fwindow, char *text, int x, int y);
+ AssetEditHeader(AssetEditWindow *fwindow,
+ char *text, int x, int y);
int handle_event();
class AssetEditByteOrderLOHI : public BC_Radial
{
public:
- AssetEditByteOrderLOHI(AssetEditWindow *fwindow, int value, int x, int y);
+ AssetEditByteOrderLOHI(AssetEditWindow *fwindow,
+ int value, int x, int y);
int handle_event();
class AssetEditByteOrderHILO : public BC_Radial
{
public:
- AssetEditByteOrderHILO(AssetEditWindow *fwindow, int value, int x, int y);
+ AssetEditByteOrderHILO(AssetEditWindow *fwindow,
+ int value, int x, int y);
int handle_event();
class AssetEditSigned : public BC_CheckBox
{
public:
- AssetEditSigned(AssetEditWindow *fwindow, int value, int x, int y);
+ AssetEditSigned(AssetEditWindow *fwindow,
+ int value, int x, int y);
int handle_event();
char info[65536];
BC_ScrollTextBox *text;
public:
- DetailAssetWindow(MWindow *mwindow, Asset *asset);
+ DetailAssetWindow(MWindow *mwindow,
+ DetailAssetDialog *detail_dialog, Asset *asset);
~DetailAssetWindow();
void create_objects();
+ DetailAssetDialog *detail_dialog;
};
-class DetailAssetThread : public Thread
+class DetailAssetDialog : public BC_DialogThread
{
MWindow *mwindow;
DetailAssetWindow *dwindow;
public:
- DetailAssetThread(MWindow *mwindow);
- ~DetailAssetThread();
+ DetailAssetDialog(MWindow *mwindow);
+ ~DetailAssetDialog();
+ void start(Asset *asset, int x, int y);
+ BC_Window* new_gui();
- void start(Asset *asset);
- void stop();
- void run();
+ Asset *asset;
+ int x, y;
};
class AssetEditByteOrderHILO;
class AssetEditSigned;
class DetailAssetWindow;
-class DetailAssetThread;
+class DetailAssetDialog;
class DetailAssetButton;
#endif
BC_MenuItem *menu_item;
BC_SubMenu *submenu;
add_item(info = new AssetPopupInfo(mwindow, this));
- add_item(format = new AWindowListFormat(mwindow));
+ add_item(format = new AWindowListFormat(mwindow, gui));
add_item(new AssetPopupSort(mwindow, this));
add_item(index = new AssetPopupBuildIndex(mwindow, this));
add_item(view = new AssetPopupView(mwindow, this));
int AssetPopupInfo::handle_event()
{
- if(mwindow->session->drag_assets->total)
- {
+ int cur_x, cur_y;
+ popup->gui->get_abs_cursor_xy(cur_x, cur_y, 0);
+
+ if( mwindow->session->drag_assets->total ) {
mwindow->awindow->asset_edit->edit_asset(
- mwindow->session->drag_assets->values[0]);
+ mwindow->session->drag_assets->values[0], cur_x, cur_y);
}
else
- if(mwindow->session->drag_clips->total)
- {
+ if( mwindow->session->drag_clips->total ) {
popup->gui->awindow->clip_edit->edit_clip(
- mwindow->session->drag_clips->values[0]);
+ mwindow->session->drag_clips->values[0], cur_x, cur_y);
}
return 1;
}
VWindow *vwindow = mwindow->get_viewer(1, DEFAULT_VWINDOW);
vwindow->gui->lock_window("AssetPopupView::handle_event");
- if(mwindow->session->drag_assets->total)
+ if( mwindow->session->drag_assets->total )
vwindow->change_source(
mwindow->session->drag_assets->values[0]);
else
- if(mwindow->session->drag_clips->total)
+ if( mwindow->session->drag_clips->total )
vwindow->change_source(
mwindow->session->drag_clips->values[0]);
// TODO: create new vwindow or change current vwindow
vwindow->gui->lock_window("AssetPopupView::handle_event");
- if(mwindow->session->drag_assets->total)
+ if( mwindow->session->drag_assets->total )
vwindow->change_source(
mwindow->session->drag_assets->values[0]);
else
- if(mwindow->session->drag_clips->total)
+ if( mwindow->session->drag_clips->total )
vwindow->change_source(
mwindow->session->drag_clips->values[0]);
void AssetListMenu::create_objects()
{
- add_item(format = new AWindowListFormat(mwindow));
- add_item(new AWindowListSort(mwindow));
- add_item(new AssetListCopy(mwindow));
- add_item(new AssetListPaste(mwindow));
+ add_item(format = new AWindowListFormat(mwindow, gui));
+ add_item(new AWindowListSort(mwindow, gui));
+ add_item(new AssetListCopy(mwindow, gui));
+ add_item(new AssetListPaste(mwindow, gui));
update_titles();
}
format->update();
}
-AssetListCopy::AssetListCopy(MWindow *mwindow)
+AssetListCopy::AssetListCopy(MWindow *mwindow, AWindowGUI *gui)
: BC_MenuItem(_("Copy file list"))
{
this->mwindow = mwindow;
+ this->gui = gui;
copy_dialog = 0;
}
AssetListCopy::~AssetListCopy()
cp += sprintf(cp, "%s\n", path);
}
*cp = 0;
+ int cur_x, cur_y;
+ gui->get_abs_cursor_xy(cur_x, cur_y, 0);
gui->unlock_window();
if( n ) {
if( !copy_dialog )
copy_dialog = new AssetCopyDialog(this);
- copy_dialog->start(text);
+ copy_dialog->start(text, cur_x, cur_y);
}
else {
eprintf(_("Nothing selected"));
copy_window = 0;
}
-void AssetCopyDialog::start(char *text)
+void AssetCopyDialog::start(char *text, int x, int y)
{
close_window();
this->text = text;
+ this->x = x; this->y = y;
BC_DialogThread::start();
}
BC_Window* AssetCopyDialog::new_gui()
{
BC_DisplayInfo display_info;
- int x = display_info.get_abs_cursor_x();
- int y = display_info.get_abs_cursor_y();
- copy_window = new AssetCopyWindow(this, x, y);
+ copy_window = new AssetCopyWindow(this);
copy_window->create_objects();
return copy_window;
}
}
-AssetCopyWindow::AssetCopyWindow(AssetCopyDialog *copy_dialog, int x, int y)
- : BC_Window(_(PROGRAM_NAME ": Copy File List"), x, y, 500, 200, 500, 200, 0, 0, 1)
+AssetCopyWindow::AssetCopyWindow(AssetCopyDialog *copy_dialog)
+ : BC_Window(_(PROGRAM_NAME ": Copy File List"),
+ copy_dialog->x - 500/2, copy_dialog->y - 200/2,
+ 500, 200, 500, 200, 0, 0, 1)
{
this->copy_dialog = copy_dialog;
}
}
-AssetListPaste::AssetListPaste(MWindow *mwindow)
+AssetListPaste::AssetListPaste(MWindow *mwindow, AWindowGUI *gui)
: BC_MenuItem(_("Paste file list"))
{
this->mwindow = mwindow;
+ this->gui = gui;
paste_dialog = 0;
}
AssetListPaste::~AssetListPaste()
int AssetListPaste::handle_event()
{
if( !paste_dialog )
+ paste_dialog->close_window();
+ else
paste_dialog = new AssetPasteDialog(this);
- paste_dialog->start();
+ int cur_x, cur_y;
+ gui->get_abs_cursor_xy(cur_x, cur_y, 0);
+ paste_dialog->start(cur_x, cur_y);
return 1;
}
BC_Window* AssetPasteDialog::new_gui()
{
- BC_DisplayInfo display_info;
- int x = display_info.get_abs_cursor_x();
- int y = display_info.get_abs_cursor_y();
-
- paste_window = new AssetPasteWindow(this, x, y);
+ paste_window = new AssetPasteWindow(this);
paste_window->create_objects();
return paste_window;
}
paste_window = 0;
}
+void AssetPasteDialog::start(int x, int y)
+{
+ this->x = x; this->y = y;
+ BC_DialogThread::start();
+}
-AssetPasteWindow::AssetPasteWindow(AssetPasteDialog *paste_dialog, int x, int y)
- : BC_Window(_(PROGRAM_NAME ": Paste File List"), x, y, 500, 200, 500, 200, 0, 0, 1)
+AssetPasteWindow::AssetPasteWindow(AssetPasteDialog *paste_dialog)
+ : BC_Window(_(PROGRAM_NAME ": Paste File List"),
+ paste_dialog->x - 500/2, paste_dialog->y - 200/2,
+ 500, 200, 500, 200, 0, 0, 1)
{
this->paste_dialog = paste_dialog;
}
class AssetListCopy : public BC_MenuItem
{
public:
- AssetListCopy(MWindow *mwindow);
+ AssetListCopy(MWindow *mwindow, AWindowGUI *gui);
~AssetListCopy();
int handle_event();
MWindow *mwindow;
+ AWindowGUI *gui;
AssetCopyDialog *copy_dialog;
};
AssetCopyDialog(AssetListCopy *copy);
~AssetCopyDialog();
- void start(char *text);
+ void start(char *text, int x, int y);
BC_Window* new_gui();
void handle_done_event(int result);
void handle_close_event(int result);
char *text;
+ int x, y;
AssetListCopy *copy;
AssetCopyWindow *copy_window;
};
class AssetCopyWindow : public BC_Window
{
public:
- AssetCopyWindow(AssetCopyDialog *copy_dialog, int x, int y);
+ AssetCopyWindow(AssetCopyDialog *copy_dialog);
~AssetCopyWindow();
void create_objects();
class AssetListPaste : public BC_MenuItem
{
public:
- AssetListPaste(MWindow *mwindow);
+ AssetListPaste(MWindow *mwindow, AWindowGUI *gui);
~AssetListPaste();
int handle_event();
MWindow *mwindow;
+ AWindowGUI *gui;
AssetPasteDialog *paste_dialog;
};
BC_Window* new_gui();
void handle_done_event(int result);
void handle_close_event(int result);
+ void start(int x, int y);
AssetListPaste *paste;
AssetPasteWindow *paste_window;
+ int x, y;
};
class AssetPasteWindow : public BC_Window
{
public:
- AssetPasteWindow(AssetPasteDialog *paste_dialog, int x, int y);
+ AssetPasteWindow(AssetPasteDialog *paste_dialog);
~AssetPasteWindow();
void create_objects();
int AWindowInfo::handle_event()
{
- gui->awindow->asset_edit->edit_asset(gui->selected_asset());
+ int cur_x, cur_y;
+ gui->get_abs_cursor_xy(cur_x, cur_y, 0);
+ gui->awindow->asset_edit->edit_asset(gui->selected_asset(), cur_x, cur_y);
return 1;
}
}
-AWindowListFormat::AWindowListFormat(MWindow *mwindow)
+AWindowListFormat::AWindowListFormat(MWindow *mwindow, AWindowGUI *gui)
: BC_MenuItem("")
{
this->mwindow = mwindow;
+ this->gui = gui;
}
int AWindowListFormat::handle_event()
{
- AWindowGUI *gui = mwindow->awindow->gui;
gui->stop_vicon_drawing();
EDLSession *session = mwindow->edl->session;
(char*)_("Display icons") : (char*)_("Display text"));
}
-AWindowListSort::AWindowListSort(MWindow *mwindow)
+AWindowListSort::AWindowListSort(MWindow *mwindow, AWindowGUI *gui)
: BC_MenuItem(_("Sort items"))
{
this->mwindow = mwindow;
+ this->gui = gui;
}
int AWindowListSort::handle_event()
{
- AWindowGUI *gui = mwindow->awindow->gui;
gui->sort_assets();
return 1;
}
class AWindowListFormat : public BC_MenuItem
{
public:
- AWindowListFormat(MWindow *mwindow);
+ AWindowListFormat(MWindow *mwindow, AWindowGUI *gui);
void update();
int handle_event();
MWindow *mwindow;
+ AWindowGUI *gui;
};
class AWindowListSort : public BC_MenuItem
{
public:
- AWindowListSort(MWindow *mwindow);
+ AWindowListSort(MWindow *mwindow, AWindowGUI *gui);
void update();
int handle_event();
MWindow *mwindow;
+ AWindowGUI *gui;
};
#endif
// After the window is closed and deleted, this is called.
void ClipEdit::handle_close_event(int result)
{
- if(!result)
- {
+ if( !result ) {
int name_ok = 1;
for( int i = 0; name_ok && i < mwindow->edl->clips.total; ++i ) {
if( !strcasecmp(clip->local_session->clip_title,
}
}
- if(!result)
- {
+ if( !result ) {
// Add to EDL
- if(create_it)
+ if( create_it )
mwindow->edl->add_clip(clip);
else // Copy clip to existing clip in EDL
original->copy_session(clip);
// Change VWindow to it if vwindow was called
// But this doesn't let you easily create a lot of clips.
- if(vwindow && create_it)
- {
+ if( vwindow && create_it ) {
// vwindow->change_source(new_edl);
}
}
- else
- {
+ else {
mwindow->session->clip_number--;
}
// For creating new clips, the original was copied in add_clip.
// For editing old clips, the original was transferred to another variable.
- if(!create_it) clip->remove_user();
+ if( !create_it ) clip->remove_user();
original = 0;
clip = 0;
create_it = 0;
{
original = clip;
- if(!create_it)
- {
+ if( !create_it ) {
this->clip = new EDL(mwindow->edl);
clip->create_objects();
clip->copy_all(original);
}
-
window = new ClipEditWindow(mwindow, this);
window->create_objects();
return window;
-void ClipEdit::edit_clip(EDL *clip)
+void ClipEdit::edit_clip(EDL *clip, int x, int y)
{
close_window();
-// Allow more than one window so we don't have to delete the clip in handle_event
- if(!this->clip)
- {
- this->clip = clip;
- this->create_it = 0;
- start();
- }
-}
-void ClipEdit::create_clip(EDL *clip)
-{
-// Allow more than one window so we don't have to delete the clip in handle_event
- if(!this->clip)
- {
- this->clip = clip;
- this->create_it = 1;
- start();
- }
+ this->clip = clip;
+ this->create_it = 0;
+ this->x = x; this->y = y;
+ start();
}
+void ClipEdit::create_clip(EDL *clip, int x, int y)
+{
+ close_window();
-
-
-
-
+ this->clip = clip;
+ this->create_it = 1;
+ this->x = x; this->y = y;
+ start();
+}
ClipEditWindow::ClipEditWindow(MWindow *mwindow, ClipEdit *thread)
: BC_Window(_(PROGRAM_NAME ": Clip Info"),
- mwindow->gui->get_abs_cursor_x(1) - 400 / 2,
- mwindow->gui->get_abs_cursor_y(1) - 350 / 2,
- 400,
- 350,
- 400,
- 430,
- 0,
- 0,
- 1)
+ thread->x -400/2, thread->y - 350/2,
+ 400, 350, 400, 430, 0, 0, 1)
{
this->mwindow = mwindow;
this->thread = thread;
ClipEdit(MWindow *mwindow, AWindow *awindow, VWindow *vwindow);
~ClipEdit();
- void edit_clip(EDL *clip);
- void create_clip(EDL *clip);
+ void edit_clip(EDL *clip, int x, int y);
+ void create_clip(EDL *clip, int x, int y);
// After the window is closed and deleted, this is called.
void handle_close_event(int result);
EDL *original;
ClipEditWindow *window;
int create_it;
+ int x, y;
};
BC_MenuItem *menu_item;
BC_SubMenu *submenu;
add_item(info = new ClipPopupInfo(mwindow, this));
- add_item(format = new AWindowListFormat(mwindow));
+ add_item(format = new AWindowListFormat(mwindow, gui));
add_item(new ClipPopupSort(mwindow, this));
add_item(view = new ClipPopupView(mwindow, this));
add_item(view_window = new ClipPopupViewWindow(mwindow, this));
int ClipPopupInfo::handle_event()
{
- if(mwindow->session->drag_assets->total)
- {
+ int cur_x, cur_y;
+ popup->gui->get_abs_cursor_xy(cur_x, cur_y, 0);
+
+ if( mwindow->session->drag_assets->total ) {
mwindow->awindow->asset_edit->edit_asset(
- mwindow->session->drag_assets->values[0]);
+ mwindow->session->drag_assets->values[0], cur_x, cur_y);
}
else
- if(mwindow->session->drag_clips->total)
- {
+ if( mwindow->session->drag_clips->total ) {
popup->gui->awindow->clip_edit->edit_clip(
- mwindow->session->drag_clips->values[0]);
+ mwindow->session->drag_clips->values[0], cur_x, cur_y);
}
return 1;
}
VWindow *vwindow = mwindow->get_viewer(1, DEFAULT_VWINDOW);
vwindow->gui->lock_window("ClipPopupView::handle_event");
- if(mwindow->session->drag_assets->total)
+ if( mwindow->session->drag_assets->total )
vwindow->change_source(
mwindow->session->drag_assets->values[0]);
else
- if(mwindow->session->drag_clips->total)
+ if( mwindow->session->drag_clips->total )
vwindow->change_source(
mwindow->session->drag_clips->values[0]);
// TODO: create new vwindow or change current vwindow
vwindow->gui->lock_window("ClipPopupView::handle_event");
- if(mwindow->session->drag_assets->total)
+ if( mwindow->session->drag_assets->total )
vwindow->change_source(
mwindow->session->drag_assets->values[0]);
else
- if(mwindow->session->drag_clips->total)
+ if( mwindow->session->drag_clips->total )
vwindow->change_source(
mwindow->session->drag_clips->values[0]);
void ClipListMenu::create_objects()
{
- add_item(format = new AWindowListFormat(mwindow));
- add_item(new AWindowListSort(mwindow));
+ add_item(format = new AWindowListFormat(mwindow, gui));
+ add_item(new AWindowListSort(mwindow, gui));
add_item(new ClipPasteToFolder(mwindow));
update();
}
#include "theme.h"
-CTimeBar::CTimeBar(MWindow *mwindow,
- CWindowGUI *gui,
- int x,
- int y,
- int w,
- int h)
- : TimeBar(mwindow,
- gui,
- x,
- y,
- w,
- h)
+CTimeBar::CTimeBar(MWindow *mwindow, CWindowGUI *gui,
+ int x, int y, int w, int h)
+ : TimeBar(mwindow, gui, x, y, w, h)
{
this->mwindow = mwindow;
this->gui = gui;
{
double start = 0, length = 0;
EDL *edl = get_edl();
- if(edl)
- {
+ if( edl ) {
start = edl->local_session->preview_start;
- if(start >= 0)
+ if( start >= 0 )
length = edl->local_session->preview_end - start;
}
- if(length <= 0)
+ if( length <= 0 )
length = get_edl_length();
return start + (double)pixel * length / get_w();
}
position = mwindow->edl->align_to_frame(position, 1);
- if(shift_down())
- {
- if(position > edl->local_session->get_selectionend(1) / 2 +
- edl->local_session->get_selectionstart(1) / 2)
- {
+ if( shift_down() ) {
+ if( position > edl->local_session->get_selectionend(1) / 2 +
+ edl->local_session->get_selectionstart(1) / 2 ) {
edl->local_session->set_selectionend(position);
}
- else
- {
+ else {
edl->local_session->set_selectionstart(position);
}
}
- else
- {
+ else {
edl->local_session->set_selectionstart(position);
edl->local_session->set_selectionend(position);
}
mwindow->gui->lock_window();
mwindow->gui->hide_cursor(0);
mwindow->gui->draw_cursor(1);
- mwindow->gui->update(0,
- 1, // 1 for incremental drawing. 2 for full refresh
- 1,
- 0,
- 1,
- 1,
- 0);
+ mwindow->gui->update(0, 1, // 1 for incremental drawing. 2 for full refresh
+ 1, 0, 1, 1, 0);
mwindow->gui->unlock_window();
mwindow->update_plugin_guis();
//printf("CTimeBar::select_label 2\n");
}
-
-
-
-
audio_options,
video_options);
break;
+#ifdef HAVE_OPENEXR
case FILE_EXR:
case FILE_EXR_LIST:
FileEXR::get_parameters(parent_window,
audio_options,
video_options);
break;
+#endif
case FILE_FLAC:
FileFLAC::get_parameters(parent_window,
asset,
"PNG",
"JPEG",
"GIF",
+#ifdef HAVE_OPENEXR
"EXR",
+#endif
"FLAC",
"CR2",
"TGA",
file = new FileGIF(this->asset, this);
return FILE_OK;
}
+#ifdef HAVE_EXR
if( !strcmp(pref->name,"EXR") ) { // EXR file
if( !FileEXR::check_sig(this->asset, data)) continue;
file = new FileEXR(this->asset, this);
return FILE_OK;
}
+#endif
if( !strcmp(pref->name,"FLAC") ) { // FLAC file
if( !FileFLAC::check_sig(this->asset, data)) continue;
file = new FileFLAC(this->asset, this);
// get the format now
// If you add another format to case 0, you also need to add another case for the
// file format #define.
- case FILE_UNKNOWN: {
- int ret = probe();
- if( ret != FILE_OK ) return ret;
- break; }
+ case FILE_UNKNOWN: {
+ int ret = probe();
+ if( ret != FILE_OK ) return ret;
+ break; }
// format already determined
- case FILE_AC3:
- file = new FileAC3(this->asset, this);
- break;
-
- case FILE_SCENE:
- file = new FileScene(this->asset, this);
- break;
-
- case FILE_FFMPEG:
- file = new FileFFMPEG(this->asset, this);
- break;
-
- case FILE_PCM:
- case FILE_WAV:
- case FILE_AU:
- case FILE_AIFF:
- case FILE_SND:
+ case FILE_AC3:
+ file = new FileAC3(this->asset, this);
+ break;
+
+ case FILE_SCENE:
+ file = new FileScene(this->asset, this);
+ break;
+
+ case FILE_FFMPEG:
+ file = new FileFFMPEG(this->asset, this);
+ break;
+
+ case FILE_PCM:
+ case FILE_WAV:
+ case FILE_AU:
+ case FILE_AIFF:
+ case FILE_SND:
//printf("File::open_file 1\n");
- file = new FileSndFile(this->asset, this);
- break;
-
- case FILE_PNG:
- case FILE_PNG_LIST:
- file = new FilePNG(this->asset, this);
- break;
-
- case FILE_JPEG:
- case FILE_JPEG_LIST:
- file = new FileJPEG(this->asset, this);
- break;
-
- case FILE_GIF:
- case FILE_GIF_LIST:
- file = new FileGIF(this->asset, this);
- break;
-
- case FILE_EXR:
- case FILE_EXR_LIST:
- file = new FileEXR(this->asset, this);
- break;
-
- case FILE_FLAC:
- file = new FileFLAC(this->asset, this);
- break;
-
- case FILE_CR2:
- case FILE_CR2_LIST:
- file = new FileCR2(this->asset, this);
- break;
-
- case FILE_TGA_LIST:
- case FILE_TGA:
- file = new FileTGA(this->asset, this);
- break;
-
- case FILE_TIFF:
- case FILE_TIFF_LIST:
- file = new FileTIFF(this->asset, this);
- break;
-
- case FILE_DB:
- file = new FileDB(this->asset, this);
- break;
-
- case FILE_MPEG:
- case FILE_AMPEG:
- case FILE_VMPEG:
- file = new FileMPEG(this->asset, this);
- break;
-
- case FILE_OGG:
- file = new FileOGG(this->asset, this);
- break;
-
- case FILE_VORBIS:
- file = new FileVorbis(this->asset, this);
- break;
+ file = new FileSndFile(this->asset, this);
+ break;
+
+ case FILE_PNG:
+ case FILE_PNG_LIST:
+ file = new FilePNG(this->asset, this);
+ break;
+
+ case FILE_JPEG:
+ case FILE_JPEG_LIST:
+ file = new FileJPEG(this->asset, this);
+ break;
+
+ case FILE_GIF:
+ case FILE_GIF_LIST:
+ file = new FileGIF(this->asset, this);
+ break;
+#ifdef HAVE_OPENEXR
+ case FILE_EXR:
+ case FILE_EXR_LIST:
+ file = new FileEXR(this->asset, this);
+ break;
+#endif
+ case FILE_FLAC:
+ file = new FileFLAC(this->asset, this);
+ break;
+
+ case FILE_CR2:
+ case FILE_CR2_LIST:
+ file = new FileCR2(this->asset, this);
+ break;
+
+ case FILE_TGA_LIST:
+ case FILE_TGA:
+ file = new FileTGA(this->asset, this);
+ break;
+
+ case FILE_TIFF:
+ case FILE_TIFF_LIST:
+ file = new FileTIFF(this->asset, this);
+ break;
+
+ case FILE_DB:
+ file = new FileDB(this->asset, this);
+ break;
+
+ case FILE_MPEG:
+ case FILE_AMPEG:
+ case FILE_VMPEG:
+ file = new FileMPEG(this->asset, this);
+ break;
+
+ case FILE_OGG:
+ file = new FileOGG(this->asset, this);
+ break;
+
+ case FILE_VORBIS:
+ file = new FileVorbis(this->asset, this);
+ break;
#ifdef HAVE_DV
- case FILE_RAWDV:
- file = new FileDV(this->asset, this);
- break;
+ case FILE_RAWDV:
+ file = new FileDV(this->asset, this);
+ break;
#endif
// try plugins
- default:
- return 1;
- break;
+ default:
+ return 1;
+ break;
}
int output_w,
int output_h)
{
- if(!asset) return 0;
-
- if(file)
- {
+ if( asset && file ) {
return asset->width == output_w &&
asset->height == output_h &&
file->can_copy_from(asset, position);
}
- else
- return 0;
+ return 0;
}
// Fill in queries about formats when adding formats here.
const char* File::formattostr(ArrayList<PluginServer*> *plugindb, int format)
{
- switch(format)
- {
- case FILE_SCENE: return _(SCENE_NAME);
- case FILE_AC3: return _(AC3_NAME);
- case FILE_WAV: return _(WAV_NAME);
- case FILE_PCM: return _(PCM_NAME);
- case FILE_AU: return _(AU_NAME);
- case FILE_AIFF: return _(AIFF_NAME);
- case FILE_SND: return _(SND_NAME);
- case FILE_PNG: return _(PNG_NAME);
- case FILE_PNG_LIST: return _(PNG_LIST_NAME);
- case FILE_JPEG: return _(JPEG_NAME);
- case FILE_JPEG_LIST: return _(JPEG_LIST_NAME);
- case FILE_CR2: return _(CR2_NAME);
- case FILE_CR2_LIST: return _(CR2_LIST_NAME);
- case FILE_FLAC: return _(FLAC_NAME);
- case FILE_EXR: return _(EXR_NAME);
- case FILE_EXR_LIST: return _(EXR_LIST_NAME);
- case FILE_MPEG: return _(MPEG_NAME);
- case FILE_AMPEG: return _(AMPEG_NAME);
- case FILE_VMPEG: return _(VMPEG_NAME);
- case FILE_TGA: return _(TGA_NAME);
- case FILE_TGA_LIST: return _(TGA_LIST_NAME);
- case FILE_TIFF: return _(TIFF_NAME);
- case FILE_TIFF_LIST: return _(TIFF_LIST_NAME);
- case FILE_OGG: return _(OGG_NAME);
- case FILE_VORBIS: return _(VORBIS_NAME);
- case FILE_RAWDV: return _(RAWDV_NAME);
- case FILE_FFMPEG: return _(FFMPEG_NAME);
- case FILE_DB: return _(DBASE_NAME);
+ switch(format) {
+ case FILE_SCENE: return _(SCENE_NAME);
+ case FILE_AC3: return _(AC3_NAME);
+ case FILE_WAV: return _(WAV_NAME);
+ case FILE_PCM: return _(PCM_NAME);
+ case FILE_AU: return _(AU_NAME);
+ case FILE_AIFF: return _(AIFF_NAME);
+ case FILE_SND: return _(SND_NAME);
+ case FILE_PNG: return _(PNG_NAME);
+ case FILE_PNG_LIST: return _(PNG_LIST_NAME);
+ case FILE_JPEG: return _(JPEG_NAME);
+ case FILE_JPEG_LIST: return _(JPEG_LIST_NAME);
+ case FILE_CR2: return _(CR2_NAME);
+ case FILE_CR2_LIST: return _(CR2_LIST_NAME);
+ case FILE_FLAC: return _(FLAC_NAME);
+ case FILE_EXR: return _(EXR_NAME);
+ case FILE_EXR_LIST: return _(EXR_LIST_NAME);
+ case FILE_MPEG: return _(MPEG_NAME);
+ case FILE_AMPEG: return _(AMPEG_NAME);
+ case FILE_VMPEG: return _(VMPEG_NAME);
+ case FILE_TGA: return _(TGA_NAME);
+ case FILE_TGA_LIST: return _(TGA_LIST_NAME);
+ case FILE_TIFF: return _(TIFF_NAME);
+ case FILE_TIFF_LIST: return _(TIFF_LIST_NAME);
+ case FILE_OGG: return _(OGG_NAME);
+ case FILE_VORBIS: return _(VORBIS_NAME);
+ case FILE_RAWDV: return _(RAWDV_NAME);
+ case FILE_FFMPEG: return _(FFMPEG_NAME);
+ case FILE_DB: return _(DBASE_NAME);
}
return _("Unknown");
}
const char* File::bitstostr(int bits)
{
//printf("File::bitstostr\n");
- switch(bits)
- {
- case BITSLINEAR8: return (NAME_8BIT);
- case BITSLINEAR16: return (NAME_16BIT);
- case BITSLINEAR24: return (NAME_24BIT);
- case BITSLINEAR32: return (NAME_32BIT);
- case BITSULAW: return (NAME_ULAW);
- case BITS_ADPCM: return (NAME_ADPCM);
- case BITSFLOAT: return (NAME_FLOAT);
+ switch(bits) {
+ case BITSLINEAR8: return (NAME_8BIT);
+ case BITSLINEAR16: return (NAME_16BIT);
+ case BITSLINEAR24: return (NAME_24BIT);
+ case BITSLINEAR32: return (NAME_32BIT);
+ case BITSULAW: return (NAME_ULAW);
+ case BITS_ADPCM: return (NAME_ADPCM);
+ case BITSFLOAT: return (NAME_FLOAT);
}
return _("Unknown");
}
{
switch(asset->format)
{
-#ifdef HAVE_FIREWIRE
+#ifdef HAVE_DV
case FILE_RAWDV: return FileDV::get_best_colormodel(asset, driver);
#endif
case FILE_MPEG: return FileMPEG::get_best_colormodel(asset, driver);
case FILE_JPEG:
case FILE_JPEG_LIST: return FileJPEG::get_best_colormodel(asset, driver);
+#ifdef HAVE_OPENEXR
case FILE_EXR:
case FILE_EXR_LIST: return FileEXR::get_best_colormodel(asset, driver);
+#endif
case FILE_PNG:
case FILE_PNG_LIST: return FilePNG::get_best_colormodel(asset, driver);
case FILE_TGA:
*
*/
+#ifdef HAVE_OPENEXR
+
#include "asset.h"
#include "bcsignals.h"
#include "clip.h"
return 0;
}
+#endif
#include "file.inc"
+#include "fileexr.inc"
#include "filelist.h"
#include "vframe.inc"
#define FILEEXR_INC
class FileEXR;
+class EXRUnit;
+class EXRConfigVideo;
+class EXRUseAlpha;
+class EXRCompression;
+class EXRCompressionItem;
#endif
if(!use_brender)
{
+#ifdef HAVE_OPENEXR
format_items.append(new BC_ListBoxItem(_(EXR_NAME)));
format_items.append(new BC_ListBoxItem(_(EXR_LIST_NAME)));
+#endif
format_items.append(new BC_ListBoxItem(_(WAV_NAME)));
format_items.append(new BC_ListBoxItem(_(RAWDV_NAME)));
format_items.append(new BC_ListBoxItem(_(AMPEG_NAME)));
close_window();
}
-void LabelEdit::start(Label *label)
+void LabelEdit::start(Label *label, int x, int y)
{
this->label = label;
+ this->x = x; this->y = y;
+
BC_DialogThread::start();
}
BC_Window *LabelEdit::new_gui()
{
- int x = mwindow->gui->get_abs_cursor_x(1) - 400 / 2;
- int y = mwindow->gui->get_abs_cursor_y(1) - 350 / 2;
- label_edit_window = new LabelEditWindow(mwindow, this, x, y);
+ label_edit_window = new LabelEditWindow(mwindow, this);
label_edit_window->create_objects();
return label_edit_window;
}
-LabelEditWindow::LabelEditWindow(MWindow *mwindow, LabelEdit *thread, int x, int y)
- : BC_Window(_(PROGRAM_NAME ": Label Info"), x, y,
+LabelEditWindow::LabelEditWindow(MWindow *mwindow, LabelEdit *thread)
+ : BC_Window(_(PROGRAM_NAME ": Label Info"),
+ thread->x - 400/2, thread->y - 350/2,
400, 350, 400, 430, 0, 0, 1)
{
this->mwindow = mwindow;
~LabelEdit();
BC_Window *new_gui();
- void start(Label *label);
+ void start(Label *label, int x, int y);
void handle_close_event(int result);
void handle_done_event(int result);
VWindow *vwindow;
Label *label;
+ int x, y;
LabelEditWindow *label_edit_window;
};
class LabelEditWindow : public BC_Window
{
public:
- LabelEditWindow(MWindow *mwindow, LabelEdit *thread, int x, int y);
+ LabelEditWindow(MWindow *mwindow, LabelEdit *thread);
~LabelEditWindow();
void create_objects();
int LabelPopupEdit::handle_event()
{
AssetPicon *result = (AssetPicon*)gui->asset_list->get_selection(0,0);
+ int cur_x, cur_y;
+ gui->get_abs_cursor_xy(cur_x, cur_y, 0);
if( result && result->label )
- gui->awindow->label_edit->start(result->label);
+ gui->awindow->label_edit->start(result->label, cur_x, cur_y);
return 1;
}
void LabelListMenu::create_objects()
{
- add_item(format = new AWindowListFormat(mwindow));
- add_item(new AWindowListSort(mwindow));
+ add_item(format = new AWindowListFormat(mwindow, gui));
+ add_item(new AWindowListSort(mwindow, gui));
}
void LabelListMenu::update()
Timer timer;
+ init_awindow();
+ if(debug) printf("MWindow::create_objects %d total_time=%d\n", __LINE__, (int)timer.get_difference());
+
init_compositor();
if(debug) printf("MWindow::create_objects %d total_time=%d\n", __LINE__, (int)timer.get_difference());
init_gui();
if(debug) printf("MWindow::create_objects %d total_time=%d\n", __LINE__, (int)timer.get_difference());
- init_awindow();
- if(debug) printf("MWindow::create_objects %d total_time=%d\n", __LINE__, (int)timer.get_difference());
-
init_levelwindow();
if(debug) printf("MWindow::create_objects %d total_time=%d\n", __LINE__, (int)timer.get_difference());
- if(debug) printf("MWindow::create_objects %d total_time=%d\n", __LINE__, (int)timer.get_difference());
-
init_indexes();
if(debug) printf("MWindow::create_objects %d total_time=%d\n", __LINE__, (int)timer.get_difference());
init_channeldb();
-
if(debug) printf("MWindow::create_objects %d total_time=%d\n", __LINE__, (int)timer.get_difference());
+
init_gwindow();
if(debug) printf("MWindow::create_objects %d total_time=%d\n", __LINE__, (int)timer.get_difference());
+
init_render();
if(debug) printf("MWindow::create_objects %d total_time=%d\n", __LINE__, (int)timer.get_difference());
+
init_brender();
init_exportedl();
init_commercials();
cp[n] = 0;
edl->update_assets(new_edl);
+ int cur_x, cur_y;
+ gui->get_abs_cursor_xy(cur_x, cur_y, 0);
gui->unlock_window();
- awindow->clip_edit->create_clip(new_edl);
+ awindow->clip_edit->create_clip(new_edl, cur_x, cur_y);
gui->lock_window("MWindow::save_clip");
save_backup();
#include "zoombar.h"
-LabelGUI::LabelGUI(MWindow *mwindow,
- TimeBar *timebar,
- int64_t pixel,
- int y,
- double position,
- VFrame **data)
- : BC_Toggle(translate_pixel(mwindow, pixel),
- y,
- data ? data : mwindow->theme->label_toggle,
- 0)
+LabelGUI::LabelGUI(MWindow *mwindow, TimeBar *timebar,
+ int64_t pixel, int y,
+ double position, VFrame **data)
+ : BC_Toggle(translate_pixel(mwindow, pixel), y,
+ data ? data : mwindow->theme->label_toggle, 0)
{
this->mwindow = mwindow;
this->timebar = timebar;
{
int result = 0;
- if (this->is_event_win() && get_buttonpress() == 3) {
- if (label)
- timebar->label_edit->start(label);
+ if( this->is_event_win() && get_buttonpress() == 3 ) {
+ if( label ) {
+ int cur_x, cur_y;
+ get_abs_cursor_xy(cur_x, cur_y, 0);
+ timebar->label_edit->start(label, cur_x, cur_y);
+ }
result = 1;
} else {
result = BC_Toggle::button_press_event();
}
- if (label)
+ if( label )
set_tooltip(this->label->textstr);
return result;
}
}
-InPointGUI::InPointGUI(MWindow *mwindow,
- TimeBar *timebar,
- int64_t pixel,
- double position)
- : LabelGUI(mwindow,
- timebar,
- pixel,
- get_y(mwindow, timebar),
- position,
- mwindow->theme->in_point)
+InPointGUI::InPointGUI(MWindow *mwindow, TimeBar *timebar,
+ int64_t pixel, double position)
+ : LabelGUI(mwindow, timebar,
+ pixel, get_y(mwindow, timebar),
+ position, mwindow->theme->in_point)
{
//printf("InPointGUI::InPointGUI %d %d\n", pixel, get_y(mwindow, timebar));
}
}
-OutPointGUI::OutPointGUI(MWindow *mwindow,
- TimeBar *timebar,
- int64_t pixel,
- double position)
- : LabelGUI(mwindow,
- timebar,
- pixel,
- get_y(mwindow, timebar),
- position,
- mwindow->theme->out_point)
+OutPointGUI::OutPointGUI(MWindow *mwindow, TimeBar *timebar,
+ int64_t pixel, double position)
+ : LabelGUI(mwindow, timebar,
+ pixel, get_y(mwindow, timebar),
+ position, mwindow->theme->out_point)
{
//printf("OutPointGUI::OutPointGUI %d %d\n", pixel, get_y(mwindow, timebar));
}
}
-PresentationGUI::PresentationGUI(MWindow *mwindow,
- TimeBar *timebar,
- int64_t pixel,
- double position)
+PresentationGUI::PresentationGUI(MWindow *mwindow, TimeBar *timebar,
+ int64_t pixel, double position)
: LabelGUI(mwindow, timebar, pixel, get_y(mwindow, timebar), position)
{
}
{
}
-TimeBar::TimeBar(MWindow *mwindow,
- BC_WindowBase *gui,
- int x,
- int y,
- int w,
- int h)
+TimeBar::TimeBar(MWindow *mwindow, BC_WindowBase *gui,
+ int x, int y, int w, int h)
: BC_SubWindow(x, y, w, h)
{
//printf("TimeBar::TimeBar %d %d %d %d\n", x, y, w, h);
TimeBar::~TimeBar()
{
- if(in_point) delete in_point;
- if(out_point) delete out_point;
- if(label_edit) delete label_edit;
+ delete in_point;
+ delete out_point;
+ delete label_edit;
labels.remove_all_objects();
presentations.remove_all_objects();
}
double TimeBar::pixel_to_position(int pixel)
{
- if(pane)
- {
+ if( pane ) {
pixel += mwindow->edl->local_session->view_start[pane->number];
}
int output = 0;
EDL *edl = get_edl();
- if(edl)
- {
- for(Label *current = edl->labels->first;
- current;
- current = NEXT)
- {
+ if( edl ) {
+ for( Label *current=edl->labels->first; current; current=NEXT ) {
int64_t pixel = position_to_pixel(current->position);
-
- if(pixel >= 0 && pixel < get_w())
- {
+ if( pixel >= 0 && pixel < get_w() ) {
// Create new label
- if(output >= labels.total)
- {
+ if( output >= labels.total ) {
LabelGUI *new_label;
add_subwindow(new_label =
new LabelGUI(mwindow,
// Reposition old label
{
LabelGUI *gui = labels.values[output];
- if(gui->pixel != pixel)
- {
+ if( gui->pixel != pixel ) {
gui->pixel = pixel;
gui->reposition(0);
}
- else
- {
+ else {
gui->draw_face(1,0);
}
labels.values[output]->label = current;
}
- if(edl->local_session->get_selectionstart(1) <= current->position &&
- edl->local_session->get_selectionend(1) >= current->position)
+ if( edl->local_session->get_selectionstart(1) <= current->position &&
+ edl->local_session->get_selectionend(1) >= current->position )
labels.values[output]->update(1);
else
- if(labels.values[output]->get_value())
+ if( labels.values[output]->get_value() )
labels.values[output]->update(0);
output++;
void TimeBar::update_highlights()
{
- for(int i = 0; i < labels.total; i++)
- {
+ for( int i = 0; i < labels.total; i++ ) {
LabelGUI *label = labels.values[i];
- if(mwindow->edl->equivalent(label->position,
+ if( mwindow->edl->equivalent(label->position,
mwindow->edl->local_session->get_selectionstart(1)) ||
- mwindow->edl->equivalent(label->position,
- mwindow->edl->local_session->get_selectionend(1)))
- {
- if(!label->get_value()) label->update(1);
+ mwindow->edl->equivalent(label->position,
+ mwindow->edl->local_session->get_selectionend(1)) ) {
+ if( !label->get_value() ) label->update(1);
}
else
- if(label->get_value()) label->update(0);
+ if( label->get_value() ) label->update(0);
}
- if(mwindow->edl->equivalent(mwindow->edl->local_session->get_inpoint(),
+ if( mwindow->edl->equivalent(mwindow->edl->local_session->get_inpoint(),
mwindow->edl->local_session->get_selectionstart(1)) ||
mwindow->edl->equivalent(mwindow->edl->local_session->get_inpoint(),
- mwindow->edl->local_session->get_selectionend(1)))
- {
- if(in_point) in_point->update(1);
+ mwindow->edl->local_session->get_selectionend(1)) ) {
+ if( in_point ) in_point->update(1);
}
else
- if(in_point) in_point->update(0);
+ if( in_point ) in_point->update(0);
- if(mwindow->edl->equivalent(mwindow->edl->local_session->get_outpoint(),
+ if( mwindow->edl->equivalent(mwindow->edl->local_session->get_outpoint(),
mwindow->edl->local_session->get_selectionstart(1)) ||
mwindow->edl->equivalent(mwindow->edl->local_session->get_outpoint(),
- mwindow->edl->local_session->get_selectionend(1)))
- {
- if(out_point) out_point->update(1);
+ mwindow->edl->local_session->get_selectionend(1)) ) {
+ if( out_point ) out_point->update(1);
}
else
- if(out_point) out_point->update(0);
+ if( out_point ) out_point->update(0);
}
void TimeBar::update_points()
int64_t pixel = !edl ? 0 :
position_to_pixel(edl->local_session->get_inpoint());
- if(in_point)
- {
- if(edl &&
- edl->local_session->inpoint_valid() &&
- pixel >= 0 && pixel < get_w())
- {
- if(!EQUIV(edl->local_session->get_inpoint(), in_point->position) ||
- in_point->pixel != pixel)
- {
+ if( in_point ) {
+ if( edl && edl->local_session->inpoint_valid() &&
+ pixel >= 0 && pixel < get_w() ) {
+ if( !EQUIV(edl->local_session->get_inpoint(), in_point->position) ||
+ in_point->pixel != pixel ) {
in_point->pixel = pixel;
in_point->position = edl->local_session->get_inpoint();
in_point->reposition(0);
}
- else
- {
+ else {
in_point->draw_face(1, 0);
}
}
- else
- {
+ else {
delete in_point;
in_point = 0;
}
}
else
- if(edl && edl->local_session->inpoint_valid() &&
- pixel >= 0 && pixel < get_w())
- {
+ if( edl && edl->local_session->inpoint_valid() &&
+ pixel >= 0 && pixel < get_w() ) {
add_subwindow(in_point = new InPointGUI(mwindow,
this, pixel, edl->local_session->get_inpoint()));
in_point->set_cursor(ARROW_CURSOR, 0, 0);
pixel = !edl ? 0 :
position_to_pixel(edl->local_session->get_outpoint());
- if(out_point)
- {
+ if( out_point ) {
if( edl && edl->local_session->outpoint_valid() &&
- pixel >= 0 && pixel < get_w())
- {
- if(!EQUIV(edl->local_session->get_outpoint(), out_point->position) ||
- out_point->pixel != pixel)
- {
+ pixel >= 0 && pixel < get_w()) {
+ if( !EQUIV(edl->local_session->get_outpoint(), out_point->position) ||
+ out_point->pixel != pixel ) {
out_point->pixel = pixel;
out_point->position = edl->local_session->get_outpoint();
out_point->reposition(0);
}
- else
- {
+ else {
out_point->draw_face(1, 0);
}
}
- else
- {
+ else {
delete out_point;
out_point = 0;
}
}
else
- if(edl &&
- edl->local_session->outpoint_valid() &&
- pixel >= 0 && pixel < get_w())
- {
+ if( edl && edl->local_session->outpoint_valid() &&
+ pixel >= 0 && pixel < get_w() ) {
add_subwindow(out_point = new OutPointGUI(mwindow,
this, pixel, edl->local_session->get_outpoint()));
out_point->set_cursor(ARROW_CURSOR, 0, 0);
int64_t pixel = -1;
int x = get_relative_cursor_x();
// Draw highlight position
- if(edl &&
- (highlighted || current_operation == TIMEBAR_DRAG) &&
- x >= 0 && x < get_w())
- {
+ if( edl && (highlighted || current_operation == TIMEBAR_DRAG) &&
+ x >= 0 && x < get_w() ) {
//printf("TimeBar::update %d %d\n", __LINE__, x);
double position = pixel_to_position(x);
update_clock(position);
}
- if(pixel < 0)
- {
+ if( pixel < 0 ) {
double position = test_highlight();
- if(position >= 0) pixel = position_to_pixel(position);
+ if( position >= 0 ) pixel = position_to_pixel(position);
}
- if(pixel >= 0 && pixel < get_w())
- {
+ if( pixel >= 0 && pixel < get_w() ) {
set_color(mwindow->theme->timebar_cursor_color);
set_line_dashes(1);
//printf("TimeBar::update %d pane=%d pixel=%jd\n", __LINE__, pane->number, pixel);
}
- if(edl)
- {
+ if( edl ) {
double playback_start = edl->local_session->playback_start;
if( playback_start >= 0 ) {
int64_t pixel = position_to_pixel(playback_start);
//printf("TimeBar::draw_range %d %p\n", __LINE__, get_edl());
- if(has_preview() && get_edl())
- {
+ if( has_preview() && get_edl() ) {
int x1, x2;
get_preview_pixels(x1, x2);
EDL *edl = get_edl();
- if(edl)
- {
+ if( edl ) {
int64_t pixel = position_to_pixel(
edl->local_session->get_selectionstart(1));
// Draw insertion point position if this timebar belongs to a window which
{
edl_length = 0;
- if(get_edl())
- {
+ if( get_edl() ) {
//printf("TimeBar::get_edl_length 1 %f\n", get_edl()->tracks->total_playable_length());
edl_length = get_edl()->tracks->total_playable_length();
}
//printf("TimeBar::get_edl_length 2\n");
- if(!EQUIV(edl_length, 0))
- {
+ if( !EQUIV(edl_length, 0) ) {
//printf("TimeBar::get_edl_length 3\n");
time_per_pixel = edl_length / get_w();
//printf("TimeBar::get_edl_length 4\n");
}
- else
- {
+ else {
time_per_pixel = 0;
}
//printf("TimeBar::get_edl_length 5\n");
get_edl_length();
- if(get_edl())
- {
- if(!EQUIV(edl_length, 0))
- {
- if(get_edl()->local_session->preview_end <= 0 ||
- get_edl()->local_session->preview_end > edl_length)
+ if( get_edl() ) {
+ if( !EQUIV(edl_length, 0) ) {
+ if( get_edl()->local_session->preview_end <= 0 ||
+ get_edl()->local_session->preview_end > edl_length )
get_edl()->local_session->preview_end = edl_length;
- if(get_edl()->local_session->preview_start >
- get_edl()->local_session->preview_end)
+ if( get_edl()->local_session->preview_start >
+ get_edl()->local_session->preview_end )
get_edl()->local_session->preview_start = 0;
x1 = (int)(get_edl()->local_session->preview_start / time_per_pixel);
x2 = (int)(get_edl()->local_session->preview_end / time_per_pixel);
}
- else
- {
+ else {
x1 = 0;
x2 = get_w();
}
int result = 0;
- if(get_edl() && cursor_inside() && buttonpress >= 0)
- {
+ if( get_edl() && cursor_inside() && buttonpress >= 0 ) {
int x1, x2, x = get_relative_cursor_x();
get_preview_pixels(x1, x2);
//printf("TimeBar::test_preview %d %d %d\n", x1, x2, x);
// Inside left handle
- if(x >= x1 - HANDLE_W && x < x1 + HANDLE_W &&
+ if( x >= x1 - HANDLE_W && x < x1 + HANDLE_W &&
// Ignore left handle if both handles are up against the left side
- x2 > HANDLE_W)
- {
- if(buttonpress)
- {
+ x2 > HANDLE_W ) {
+ if( buttonpress ) {
current_operation = TIMEBAR_DRAG_LEFT;
start_position = get_edl()->local_session->preview_start;
start_cursor_x = x;
}
- else if(get_cursor() != LEFT_CURSOR)
+ else if( get_cursor() != LEFT_CURSOR )
set_cursor(LEFT_CURSOR, 0, 1);
result = 1;
}
// Inside right handle
- else if(x >= x2 - HANDLE_W && x < x2 + HANDLE_W &&
+ else if( x >= x2 - HANDLE_W && x < x2 + HANDLE_W &&
// Ignore right handle if both handles are up against the right side
- x1 < get_w() - HANDLE_W)
- {
- if(buttonpress)
- {
+ x1 < get_w() - HANDLE_W ) {
+ if( buttonpress ) {
current_operation = TIMEBAR_DRAG_RIGHT;
start_position = get_edl()->local_session->preview_end;
start_cursor_x = x;
}
- else if(get_cursor() != RIGHT_CURSOR)
+ else if( get_cursor() != RIGHT_CURSOR )
set_cursor(RIGHT_CURSOR, 0, 1);
result = 1;
}
// Inside preview
- else if(get_button_down() && get_buttonpress() == 3 &&
- x >= x1 && x < x2)
- {
- if(buttonpress)
- {
+ else if( get_button_down() && get_buttonpress() == 3 &&
+ x >= x1 && x < x2 ) {
+ if( buttonpress ) {
current_operation = TIMEBAR_DRAG_CENTER;
starting_start_position = get_edl()->local_session->preview_start;
starting_end_position = get_edl()->local_session->preview_end;
start_cursor_x = x;
}
- if(get_cursor() != HSEPARATE_CURSOR)
+ if( get_cursor() != HSEPARATE_CURSOR )
set_cursor(HSEPARATE_CURSOR, 0, 1);
result = 1;
}
}
- if(!result && get_cursor() != ARROW_CURSOR)
+ if( !result && get_cursor() != ARROW_CURSOR )
set_cursor(ARROW_CURSOR, 0, 1);
{
int result = 0, x = get_relative_cursor_x();
- if(current_operation == TIMEBAR_DRAG_LEFT)
- {
+ if( current_operation == TIMEBAR_DRAG_LEFT ) {
get_edl()->local_session->preview_start =
start_position + time_per_pixel * (x - start_cursor_x);
CLAMP(get_edl()->local_session->preview_start,
result = 1;
}
else
- if(current_operation == TIMEBAR_DRAG_RIGHT)
- {
+ if( current_operation == TIMEBAR_DRAG_RIGHT ) {
get_edl()->local_session->preview_end =
start_position + time_per_pixel * (x - start_cursor_x);
CLAMP(get_edl()->local_session->preview_end,
result = 1;
}
else
- if(current_operation == TIMEBAR_DRAG_CENTER)
- {
+ if( current_operation == TIMEBAR_DRAG_CENTER ) {
double dt = time_per_pixel * (x - start_cursor_x);
get_edl()->local_session->preview_start = starting_start_position + dt;
get_edl()->local_session->preview_end = starting_end_position + dt;
- if(get_edl()->local_session->preview_start < 0)
- {
+ if( get_edl()->local_session->preview_start < 0 ) {
get_edl()->local_session->preview_end -= get_edl()->local_session->preview_start;
get_edl()->local_session->preview_start = 0;
}
else
- if(get_edl()->local_session->preview_end > edl_length)
- {
+ if( get_edl()->local_session->preview_end > edl_length ) {
get_edl()->local_session->preview_start -= get_edl()->local_session->preview_end - edl_length;
get_edl()->local_session->preview_end = edl_length;
}
//printf("TimeBar::move_preview %d %d\n", __LINE__, current_operation);
- if(result)
- {
+ if( result ) {
update_preview();
redraw = 1;
}
int TimeBar::button_press_event()
{
int result = 0;
- if(is_event_win() && cursor_above())
- {
- if(has_preview() && get_buttonpress() == 3)
- {
+ if( is_event_win() && cursor_above() ) {
+ if( has_preview() && get_buttonpress() == 3 ) {
result = test_preview(1);
}
// Change time format
- else if(ctrl_down())
- {
- if(get_buttonpress() == 1)
+ else if( ctrl_down() ) {
+ if( get_buttonpress() == 1 )
mwindow->next_time_format();
else
- if(get_buttonpress() == 2)
+ if( get_buttonpress() == 2 )
mwindow->prev_time_format();
result = 1;
}
- else if(get_buttonpress() == 1)
- {
+ else if( get_buttonpress() == 1 ) {
stop_playback();
// Select region between two labels
- if(get_double_click())
- {
+ if( get_double_click() ) {
int x = get_relative_cursor_x();
double position = pixel_to_position(x);
// Test labels
select_region(position);
}
- else
- {
+ else {
// Reposition highlight cursor
update_cursor();
int redraw = 0;
//printf("TimeBar::cursor_motion_event %d %p %d\n", __LINE__, this, current_operation);
- switch(current_operation)
+ switch( current_operation )
{
case TIMEBAR_DRAG:
{
case TIMEBAR_DRAG_LEFT:
case TIMEBAR_DRAG_RIGHT:
case TIMEBAR_DRAG_CENTER:
- if(has_preview())
+ if( has_preview() )
result = move_preview(redraw);
break;
default:
- if(cursor_above())
- {
+ if( cursor_above() ) {
highlighted = 1;
redraw = 1;
}
//printf("TimeBar::cursor_motion_event 20\n");
- if(has_preview())
+ if( has_preview() )
result = test_preview(0);
//printf("TimeBar::cursor_motion_event 30\n");
break;
//printf("TimeBar::cursor_motion_event %d %d\n", __LINE__, current_operation);
- if(redraw)
- {
+ if( redraw ) {
update(1);
}
//printf("TimeBar::cursor_motion_event %d %p %d\n", __LINE__, this, current_operation);
int TimeBar::cursor_leave_event()
{
- if(highlighted)
- {
+ if( highlighted ) {
highlighted = 0;
update(1);
}
//printf("TimeBar::button_release_event %d %d\n", __LINE__, current_operation);
int result = 0;
int need_redraw = 0;
- switch(current_operation)
+ switch( current_operation )
{
case TIMEBAR_DRAG:
mwindow->gui->get_focused_pane()->canvas->stop_dragscroll();
break;
default:
- if(current_operation != TIMEBAR_NONE)
- {
+ if( current_operation != TIMEBAR_NONE ) {
current_operation = TIMEBAR_NONE;
result = 1;
}
break;
}
- if((!cursor_above() && highlighted) || need_redraw)
- {
+ if( (!cursor_above() && highlighted) || need_redraw ) {
highlighted = 0;
update(1);
}
int TimeBar::select_region(double position)
{
Label *start = 0, *end = 0, *current;
- for(current = mwindow->edl->labels->first; current; current = NEXT)
- {
- if(current->position > position)
- {
+ for( current = mwindow->edl->labels->first; current; current = NEXT ) {
+ if( current->position > position ) {
end = current;
break;
}
}
- for(current = mwindow->edl->labels->last ; current; current = PREVIOUS)
- {
- if(current->position <= position)
- {
+ for( current = mwindow->edl->labels->last ; current; current = PREVIOUS ) {
+ if( current->position <= position ) {
start = current;
break;
}
}
// Select region
- if(end != start)
- {
- if(!start)
+ if( end != start ) {
+ if( !start )
mwindow->edl->local_session->set_selectionstart(0);
else
mwindow->edl->local_session->set_selectionstart(start->position);
- if(!end)
+ if( !end )
mwindow->edl->local_session->set_selectionend(mwindow->edl->tracks->total_length());
else
mwindow->edl->local_session->set_selectionend(end->position);
}
else
- if(end || start)
- {
+ if( end || start ) {
mwindow->edl->local_session->set_selectionstart(start->position);
mwindow->edl->local_session->set_selectionend(start->position);
}
CFG_CFLAGS+=" -DPNG_SKIP_SETJMP_CHECK=1"
CFG_CFLAGS+=" -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64"
CFG_CFLAGS+=" -I/usr/include/freetype2"
-CFG_CFLAGS+=" -I/usr/include/OpenEXR"
AC_DEFUN([CHECK_WITH], [
AC_ARG_WITH([$1],
CHECK_WANT([DL], [auto], [system has libdl], [
CHECK_LIB([DL], [dl], [dlopen])])
+CHECK_WANT([EXR], [auto], [use exr], [])
+
CHECK_WANT([NUMA], [auto], [system has libnuma], [
CHECK_LIB([NUMA], [numa], [numa_alloc])])
-
-AC_MSG_CHECKING([for openexr available])
-saved_LIBS="$LIBS"
-saved_CXXFLAGS="$CXXFLAGS"
-# ilmbase libs
-LIBS=" -lIlmImf -lIlmThread -lIex"
-CXXFLAGS="-I/usr/include/OpenEXR"
-AC_LANG_PUSH(C++)
-AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+CHECK_WANT([OPENEXR], [auto], [use openexr], [
+ AC_MSG_CHECKING([for openexr available])
+ saved_LIBS="$LIBS"
+ saved_CXXFLAGS="$CXXFLAGS"
+ # ilmbase libs
+ LIBS=" -lIlmImf -lIlmThread -lIex"
+ CXXFLAGS="-I/usr/include/OpenEXR"
+ AC_LANG_PUSH(C++)
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include "ImfChannelList.h"
#include "ImfChromaticities.h"
#include "ImfCompression.h"
EXRIStream() : Imf::IStream("mypath") {} };
class EXROStream : public Imf::OStream { public:
EXROStream() : Imf::OStream("mypath") {} };
-]])], [HAVE_openexr=yes], [HAVE_openexr=no])
-if test "x$HAVE_openexr" = "xyes"; then
- SHARED_openexr="$LIBS"
-fi
-LIBS="$saved_LIBS"
-CXXFLAGS="$saved_CXXFLAGS"
-AC_LANG_POP(C++)
-AC_MSG_RESULT([$HAVE_openexr])
-AC_SUBST([HAVE_openexr])
+]])], [HAVE_OPENEXR=yes], [HAVE_OPENEXR=no])
+ RESULT="$HAVE_OPENEXR"
+ if test "x$RESULT" = "xyes"; then
+ SHARED_openexr="$LIBS"
+ CFG_CFLAGS+=" -I/usr/include/OpenEXR"
+ fi
+ LIBS="$saved_LIBS"
+ CXXFLAGS="$saved_CXXFLAGS"
+ AC_LANG_POP(C++)
+ AC_MSG_RESULT([$HAVE_OPENEXR])
+])
+AC_SUBST([HAVE_OPENEXR])
# build global_config
OBJDIR=`uname -m`
echo "AC_HELP_STRING([------],[-------])"
AC_DEFUN([PKG_DISABLED],[
- BUILD_$1=0
- AC_SUBST(BUILD_$1)
- echo "AC_HELP_STRING([disabled],[$1])"
+ PKG_$1="no"
+ BUILD_$1=0
+ AC_SUBST(BUILD_$1)
+ echo "AC_HELP_STRING([disabled],[$1])"
])
AC_DEFUN([PKG_SHARED],[
BUILD_$1=0
echo "AC_HELP_STRING([shared],[$1])"
])
AC_DEFUN([PKG_STATIC],[
+ PKG_$1="yes"
BUILD_$1=1
AC_SUBST(BUILD_$1)
STATIC_BLDS+=" [$1]"
libtheora/libogg libtheora/libvorbis ; do
lib=`dirname $dep`; needs=`basename $dep`
eval pkg_lib="\$PKG_$lib"; eval needs_lib="\$HAVE_$needs";
+ echo "dep lib=$lib, needs=$needs, pkg_lib=$pkg_lib, needs_lib=$needs_lib" > /dev/tty
if test "x$pkg_lib" != "xno"; then
eval "PKG_$needs=yes"
fi
PKG_PROVIDE([fftw])
PKG_PROVIDE([flac])
PKG_PROVIDE([giflib])
-PKG_PROVIDE([ilmbase])
+PKG_PROVIDE([ilmbase], [$WANT_OPENEXR])
PKG_PROVIDE([ladspa],[$WANT_LADSPA_BUILD])
PKG_PROVIDE([lame])
PKG_PROVIDE([libavc1394],[$WANT_FIREWIRE])
PKG_PROVIDE([libuuid])
PKG_PROVIDE([libvorbis])
PKG_PROVIDE([mjpegtools])
-PKG_PROVIDE([openexr])
+echo "WANT_OPENEXR = $WANT_OPENEXR" > /dev/tty
+PKG_PROVIDE([openexr], [$WANT_OPENEXR])
+echo "PKG_openexr = $PKG_openexr" > /dev/tty
PKG_PROVIDE([openjpeg])
PKG_PROVIDE([tiff])
PKG_PROVIDE([twolame])
echo ""
for v in GL XFT XXF86VM OSS ALSA FIREWIRE DV DVB \
- VIDEO4LINUX2 ESOUND PACTL; do
+ VIDEO4LINUX2 ESOUND PACTL OPENEXR; do
eval vv="\$WANT_$v"
if test "x$vv" != "xno"; then
CFG_CFLAGS+=" -DHAVE_$v"
echo "x265.cfg_params := -DENABLE_SHARED=no -DHIGH_BIT_DEPTH:BOOL=ON" # -DMAIN12:BOOL=ON"
fi
-for pkg in $STATIC_PKGS; do echo "static_pkgs += $pkg"; done
+for pkg in $STATIC_PKGS; do
+ eval pkg_lib="\$PKG_$pkg"
+ if test "x$pkg_lib" = "xno"; then continue; fi;
+ echo "static_pkgs += $pkg"
+done
echo ""
+
for pkg in $STATIC_BLDS; do
echo "static_blds += $pkg"
ver_pkg=ver_$pkg
This runs a dialog that lets you Add/Del/Edit the items in the main menu popup.  Possible options are:<br/> <br/>1) Add a new menu item/script: <br/>    click Add<br/>    in the Label box, change the word "new" to the desired menu label<br/>    in the Commands box, type the command lines to be included in the script<br/>    (for example: Label => gimp; Commands => gimp)<br/>    check-OK in the Commands window<br/>    check-OK in the Shell window<br/>    click on OK or Apply in the Preferences window (WILL NOT TAKE EFFECT UNTIL CLICK)<br/>
2) Del to delete an existing menu item (for example manual):<br/>     select to highlight an entry in the Cinelerra: Shell listbox<br/>     click Del <br/>     check-OK in the Shell window<br/>     click on OK or Apply in the Preferences window (the entry is destroyed)<br/>
3) Edit an existing menu item:<br/>    click Edit<br/>    select to highlight an entry in the Cinelerra: Shell listbox<br/>    click edit (the edit dialog appears)<br/>    set the label and/or commands to the new desired values<br/>    check-OK in the Shell window<br/>    click on OK or Apply in the Preferences window<br/>
-<hr/>
-<a name="outline"></a><h1>Document Outline</h1>
-<ul>
-<li><a href="ShellCmdss.html#1">Slide 1</a></li>
-</ul>
-<hr/>
</body>
</html>