$(OBJDIR)/avc1394control.o \
$(OBJDIR)/avc1394transport.o \
$(OBJDIR)/awindowgui.o \
- $(OBJDIR)/awindowmenu.o \
$(OBJDIR)/awindow.o \
$(OBJDIR)/batch.o \
$(OBJDIR)/batchrender.o \
$(OBJDIR)/chantables.o \
$(OBJDIR)/cicolors.o \
$(OBJDIR)/clipedit.o \
+ $(OBJDIR)/clippopup.o \
$(OBJDIR)/colorpicker.o \
$(OBJDIR)/commercials.o \
$(OBJDIR)/commonrender.o \
$(OBJDIR)/filexml.o \
$(OBJDIR)/floatauto.o \
$(OBJDIR)/floatautos.o \
+ $(OBJDIR)/folderlistmenu.o \
$(OBJDIR)/formatcheck.o \
$(OBJDIR)/formatpopup.o \
$(OBJDIR)/formatpresets.o \
$(OBJDIR)/keyframepopup.o \
$(OBJDIR)/keyframes.o \
$(OBJDIR)/labeledit.o \
+ $(OBJDIR)/labelpopup.o \
$(OBJDIR)/labelnavigate.o \
$(OBJDIR)/labels.o \
$(OBJDIR)/levelwindowgui.o \
use_header = 1;
id = EDL::next_id();
- reset_timecode();
return 0;
}
//printf("Asset::boundaries %d %d %f\n", __LINE__, sample_rate, frame_rate);
}
-int Asset::reset_timecode()
-{
- strcpy(reel_name, "cin0000");
- reel_number = 0;
- tcstart = 0;
- tcend = 0;
- tcformat = 0;
-
- return 0;
-}
-
void Asset::copy_from(Asset *asset, int do_index)
{
copy_location(asset);
tiff_cmodel = asset->tiff_cmodel;
tiff_compression = asset->tiff_compression;
-
- strcpy(reel_name, asset->reel_name);
- reel_number = asset->reel_number;
- tcstart = asset->tcstart;
- tcend = asset->tcend;
- tcformat = asset->tcformat;
}
int64_t Asset::get_index_offset(int channel)
interlace_fixmethod == asset.interlace_fixmethod &&
width == asset.width &&
height == asset.height &&
- !strcmp(vcodec, asset.vcodec) &&
- strcmp(reel_name, asset.reel_name) == 0 &&
- reel_number == asset.reel_number &&
- tcstart == asset.tcstart &&
- tcend == asset.tcend &&
- tcformat == asset.tcformat);
+ !strcmp(vcodec, asset.vcodec));
if(result && format == FILE_FFMPEG)
result = !strcmp(ff_video_options, asset.ff_video_options) &&
ff_video_bitrate == asset.ff_video_bitrate &&
audio_length = file->tag.get_property("AUDIO_LENGTH", (int64_t)0);
acodec[0] = 0;
file->tag.get_property("ACODEC", acodec);
-
- if(!video_data)
- {
- tcstart = 0;
- tcend = audio_length;
- tcformat = 0;
- }
return 0;
}
ilacefixmethod_to_xmltext(string, ILACE_FIXMETHOD_NONE);
interlace_fixmethod = ilacefixmethod_from_xmltext(file->tag.get_property("INTERLACE_FIXMETHOD",string), ILACE_FIXMETHOD_NONE);
- file->tag.get_property("REEL_NAME", reel_name);
- reel_number = file->tag.get_property("REEL_NUMBER", reel_number);
- tcstart = file->tag.get_property("TCSTART", tcstart);
- tcend = file->tag.get_property("TCEND", tcend);
- tcformat = file->tag.get_property("TCFORMAT", tcformat);
-
return 0;
}
ilacefixmethod_to_xmltext(string, interlace_fixmethod);
file->tag.set_property("INTERLACE_FIXMETHOD", string);
-
- file->tag.set_property("REEL_NAME", reel_name);
- file->tag.set_property("REEL_NUMBER", reel_number);
- file->tag.set_property("TCSTART", tcstart);
- file->tag.set_property("TCEND", tcend);
- file->tag.set_property("TCFORMAT", tcformat);
-
file->append_tag();
if(video_data)
file->tag.set_title("/VIDEO");
tiff_cmodel = GET_DEFAULT("TIFF_CMODEL", tiff_cmodel);
tiff_compression = GET_DEFAULT("TIFF_COMPRESSION", tiff_compression);
- GET_DEFAULT("REEL_NAME", reel_name);
- reel_number = GET_DEFAULT("REEL_NUMBER", reel_number);
- tcstart = GET_DEFAULT("TCSTART", tcstart);
- tcend = GET_DEFAULT("TCEND", tcend);
- tcformat = GET_DEFAULT("TCFORMAT", tcformat);
-
boundaries();
}
UPDATE_DEFAULT("SINGLE_FRAME", single_frame);
}
-
- UPDATE_DEFAULT("REEL_NAME", reel_name);
- UPDATE_DEFAULT("REEL_NUMBER", reel_number);
- UPDATE_DEFAULT("TCSTART", tcstart);
- UPDATE_DEFAULT("TCEND", tcend);
- UPDATE_DEFAULT("TCFORMAT", tcformat);
}
" height %d vcodec %4.4s aspect_ratio %f ilace_mode %s\n",
video_data, layers, program, frame_rate, width, height,
vcodec, aspect_ratio,string);
- fprintf(fp," reel_name %s reel_number %i tcstart %jd tcend %jd tcf %d\n",
- reel_name, reel_number, tcstart, tcend, tcformat);
fprintf(fp," video_length %jd repeat %d\n", video_length, single_frame);
-
-
return 0;
}
return 0;
}
-int Asset::set_timecode(char *tc, int format, int end)
-{
- int hr, min, sec;
-
- hr = ((int) tc[0] - 48) * 10 + (int) tc[1] - 48;
- min = ((int) tc[3] - 48) * 10 + (int) tc[4] - 48;
- sec = ((int) tc[6] - 48) * 10 + (int) tc[7] - 48;
-
- // This needs to be modified to handle drop-frame
-
- if(end)
- tcend = (int64_t) (((hr * 3600) + (min * 60) + sec) * frame_rate);
- else
- tcstart = (int64_t) (((hr * 3600) + (min * 60) + sec) * frame_rate);
-
- tcformat = format;
- return 0;
-}
-
-
int read_index(FileXML *xml);
void reset_audio();
void reset_video();
- int set_timecode(char *tc, int format, int end);
- int reset_timecode();
// Output path is the path of the output file if name truncation is desired.
// It is a "" if; complete names should be used.
int layers, program;
double frame_rate;
-// Timecode information. User setable, in case of errors in source
- char reel_name[BCTEXTLEN];
- int reel_number;
- int64_t tcstart;
- int64_t tcend;
- int tcformat;
-
int actual_width, actual_height;
int width, height;
// String or FourCC describing compression
void AssetEdit::handle_done_event(int result)
{
- if( !result && window->tc_hours_textbox ) {
- changed_params->tcstart = ceil(indexable->get_frame_rate() *
- (atoi(window->tc_hours_textbox->get_text()) * 3600 +
- atoi(window->tc_minutes_textbox->get_text()) * 60 +
- atoi(window->tc_seconds_textbox->get_text()))) +
- atoi(window->tc_rest_textbox->get_text());
- }
}
void AssetEdit::handle_close_event(int result)
return window;
}
-
-
-
-
-
-
-
+int AssetEdit::window_height()
+{
+ int h = 128 + 64;
+ if( indexable->have_audio() )
+ h += 180;
+ if( indexable->have_video() ) {
+ h += 200;
+ if( indexable->is_asset ) {
+ Asset *asset = (Asset *)indexable;
+ if( asset->format == FILE_MPEG ||
+ asset->format == FILE_FFMPEG ) {
+ h += 40;
+ }
+ }
+ }
+ return h;
+}
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) - (128 + 64 +
- (!asset_edit->indexable->have_audio() ? 0 : 180) +
- (!asset_edit->indexable->have_video() ? 0 : 350)) / 2,
- 450, (128 + 64 +
- (!asset_edit->indexable->have_audio() ? 0 : 180) +
- (!asset_edit->indexable->have_video() ? 0 : 350)), 0, 0, 1)
+ mwindow->gui->get_abs_cursor_y(1) - asset_edit->window_height() / 2,
+ 450, asset_edit->window_height(), 0, 0, 1)
{
this->mwindow = mwindow;
this->asset_edit = asset_edit;
lohi = 0;
allow_edits = 0;
detail_thread = 0;
- tc_hours_textbox = 0;
- tc_minutes_textbox = 0;
- tc_seconds_textbox = 0;
- tc_rest_textbox = 0;
win_width = 0;
win_height = 0;
}
ilacefixoption_chkboxw->ilacefixmethod_listbox = listboxw;
ilacefixoption_chkboxw->showhideotherwidgets();
y += textboxw->get_h() + 5;
-
- x = x1;
- add_subwindow(new BC_Title(x, y, _("Reel Name:")));
- x = x2;
- add_subwindow(new AssetEditReelName(this, x, y));
- y += 30;
-
- x = x1;
- add_subwindow(new BC_Title(x, y, _("Reel Number:")));
- x = x2;
- add_subwindow(new AssetEditReelNumber(this, x, y));
- y += 30;
-
- x = x1;
- add_subwindow(new BC_Title(x, y, _("Time Code Start:")));
- x = x2;
-
-// Calculate values to enter into textboxes
- char text[32], *tc = text;
- if( asset )
- Units::totext(tc, asset->tcstart / asset->frame_rate,
- TIME_HMSF, asset->sample_rate, asset->frame_rate);
- else
- strcpy(tc, "0:00:00:00");
-
- const char *tc_hours = tc, *tc_minutes, *tc_seconds, *tc_rest;
- tc = strchr(tc, ':'); *tc++ = 0; tc_minutes = tc;
- tc = strchr(tc, ':'); *tc++ = 0; tc_seconds = tc;
- tc = strchr(tc, ':'); *tc++ = 0; tc_rest = tc;
-
- int padw = BC_Title::calculate_w(this, ":", MEDIUMFONT);
- int fldw = BC_Title::calculate_w(this, "00", MEDIUMFONT) + 5;
- add_subwindow(tc_hours_textbox = new BC_TextBox(x, y, fldw, 1, tc_hours));
- add_subwindow(new BC_Title(x += tc_hours_textbox->get_w(), y, ":"));
- add_subwindow(tc_minutes_textbox = new BC_TextBox(x += padw, y, fldw, 1, tc_minutes));
- add_subwindow(new BC_Title(x += tc_minutes_textbox->get_w(), y, ":"));
- add_subwindow(tc_seconds_textbox = new BC_TextBox(x += padw, y , fldw, 1, tc_seconds));
- add_subwindow(new BC_Title(x += tc_seconds_textbox->get_w(), y, ":"));
- add_subwindow(tc_rest_textbox = new BC_TextBox(x += 10, y, fldw, 1, tc_rest));
-
- y += 30;
}
add_subwindow(new BC_OKButton(this));
dwindow = 0;
}
-
-
-
-
-AssetEditReelName::AssetEditReelName(AssetEditWindow *fwindow, int x, int y)
- : BC_TextBox(x, y, 220, 1, fwindow->asset_edit->changed_params->reel_name,
- 1, MEDIUMFONT, 1)
-{
- this->fwindow = fwindow;
-}
-AssetEditReelName::~AssetEditReelName()
-{
-}
-int AssetEditReelName::handle_event()
-{
- Asset *asset = fwindow->asset_edit->changed_params;
- strcpy(asset->reel_name, get_text());
- return 1;
-}
-
-
-
-
-
-AssetEditReelNumber::AssetEditReelNumber(AssetEditWindow *fwindow, int x, int y)
- : BC_TextBox(x, y, 200, 1, fwindow->asset_edit->changed_params->reel_number)
-{
- this->fwindow = fwindow;
-}
-AssetEditReelNumber::~AssetEditReelNumber()
-{
-}
-int AssetEditReelNumber::handle_event()
-{
- Asset *asset = fwindow->asset_edit->changed_params;
- asset->reel_number = atoi(get_text());
- return 1;
-}
-
-
-
#define ASSETEDIT_H
#include "asset.inc"
+#include "assetedit.inc"
#include "awindow.inc"
#include "bcdialog.h"
#include "bitspopup.inc"
#include "resizetrackthread.inc"
-class AssetEditReelNumber;
-class AssetEditReelName;
-class AssetEditByteOrderHILO;
-class AssetEditByteOrderLOHI;
-class AssetEditPath;
-class AssetEditPathText;
-class AssetEditWindow;
-
-class DetailAssetWindow;
-class DetailAssetThread;
-class DetailAssetButton;
-
class AssetEdit : public BC_DialogThread
{
public:
void handle_done_event(int result);
void handle_close_event(int result);
BC_Window* new_gui();
+ int window_height();
Indexable *indexable;
MWindow *mwindow;
AssetEditPath *path_button;
AssetEditByteOrderHILO *hilo;
AssetEditByteOrderLOHI *lohi;
- BC_TextBox *tc_hours_textbox, *tc_minutes_textbox;
- BC_TextBox *tc_seconds_textbox, *tc_rest_textbox;
BitsPopup *bitspopup;
int allow_edits;
MWindow *mwindow;
AssetEditWindow *fwindow;
};
-class AssetEditReelName : public BC_TextBox
-{
-public:
- AssetEditReelName(AssetEditWindow *fwindow, int x, int y);
- ~AssetEditReelName();
-
- int handle_event();
-
- AssetEditWindow *fwindow;
-};
-
-class AssetEditReelNumber : public BC_TextBox
-{
-public:
- AssetEditReelNumber(AssetEditWindow *fwindow, int x, int y);
- ~AssetEditReelNumber();
-
- int handle_event();
-
- AssetEditWindow *fwindow;
-};
-
class DetailAssetWindow : public BC_Window
{
MWindow *mwindow;
class AssetEdit;
class AssetEditWindow;
+class AssetEditPath;
+class AssetEditPathText;
+class AssetEditFormat;
+class AssetEditChannels;
+class AssetEditRate;
+class AssetEditFRate;
+class Interlaceautofix;
+class AssetEditILaceautofixoption;
+class AssetEditILacemode;
+class AssetEditInterlacemodePulldown;
+class AssetEditILacefixmethod;
+class AssetEditHeader;
+class AssetEditByteOrderLOHI;
+class AssetEditByteOrderHILO;
+class AssetEditSigned;
+class DetailAssetWindow;
+class DetailAssetThread;
+class DetailAssetButton;
#endif
*
*/
+#include "asset.h"
#include "assetedit.h"
#include "assetpopup.h"
#include "assetremove.h"
#include "awindow.h"
#include "awindowgui.h"
-#include "awindowmenu.h"
+#include "bcdisplayinfo.h"
#include "bcsignals.h"
#include "clipedit.h"
+#include "cstrdup.h"
#include "cwindow.h"
#include "cwindowgui.h"
#include "edl.h"
+#include "edlsession.h"
+#include "filexml.h"
#include "language.h"
#include "localsession.h"
+#include "mainerror.h"
#include "mainindexes.h"
#include "mainsession.h"
#include "mwindow.h"
#include "vwindowgui.h"
-
AssetPopup::AssetPopup(MWindow *mwindow, AWindowGUI *gui)
- : BC_PopupMenu(0,
- 0,
- 0,
- "",
- 0)
+ : BC_PopupMenu(0, 0, 0, "", 0)
{
this->mwindow = mwindow;
this->gui = gui;
void AssetPopup::create_objects()
{
+ BC_MenuItem *menu_item;
+ BC_SubMenu *submenu;
add_item(info = new AssetPopupInfo(mwindow, this));
- add_item(format = new AssetListFormat(mwindow));
+ add_item(format = new AWindowListFormat(mwindow));
add_item(new AssetPopupSort(mwindow, this));
add_item(index = new AssetPopupBuildIndex(mwindow, this));
add_item(view = new AssetPopupView(mwindow, this));
add_item(view_window = new AssetPopupViewWindow(mwindow, this));
add_item(new AssetPopupPaste(mwindow, this));
- add_item(new AssetMatchSize(mwindow, this));
- add_item(new AssetMatchRate(mwindow, this));
- add_item(new AssetMatchAll(mwindow, this));
- add_item(new AssetPopupProjectRemove(mwindow, this));
- add_item(new AssetPopupDiskRemove(mwindow, this));
+ add_item(menu_item = new BC_MenuItem(_("Match...")));
+ menu_item->add_submenu(submenu = new BC_SubMenu());
+ submenu->add_submenuitem(new AssetMatchSize(mwindow, this));
+ submenu->add_submenuitem(new AssetMatchRate(mwindow, this));
+ submenu->add_submenuitem(new AssetMatchAll(mwindow, this));
+ add_item(menu_item = new BC_MenuItem(_("Remove...")));
+ menu_item->add_submenu(submenu = new BC_SubMenu());
+ submenu->add_submenuitem(new AssetPopupProjectRemove(mwindow, this));
+ submenu->add_submenuitem(new AssetPopupDiskRemove(mwindow, this));
}
void AssetPopup::paste_assets()
}
-
-
-
-
-
-
-
AssetPopupInfo::AssetPopupInfo(MWindow *mwindow, AssetPopup *popup)
: BC_MenuItem(_("Info..."))
{
}
-
-
-
-
AssetPopupBuildIndex::AssetPopupBuildIndex(MWindow *mwindow, AssetPopup *popup)
: BC_MenuItem(_("Rebuild index"))
{
}
-
-
-
-
-
AssetPopupSort::AssetPopupSort(MWindow *mwindow, AssetPopup *popup)
: BC_MenuItem(_("Sort items"))
{
}
-
-
-
-
-
AssetPopupView::AssetPopupView(MWindow *mwindow, AssetPopup *popup)
: BC_MenuItem(_("View"))
{
}
-
-
-
-
-
AssetPopupViewWindow::AssetPopupViewWindow(MWindow *mwindow, AssetPopup *popup)
: BC_MenuItem(_("View in new window"))
{
}
-
-
-
-
-
AssetPopupPaste::AssetPopupPaste(MWindow *mwindow, AssetPopup *popup)
: BC_MenuItem(_("Paste"))
{
}
-
-
-
-
-
-
AssetMatchSize::AssetMatchSize(MWindow *mwindow, AssetPopup *popup)
: BC_MenuItem(_("Match project size"))
{
return 1;
}
-
-
-
-
-
-
-
AssetMatchRate::AssetMatchRate(MWindow *mwindow, AssetPopup *popup)
: BC_MenuItem(_("Match frame rate"))
{
return 1;
}
+AssetMatchAll::AssetMatchAll(MWindow *mwindow, AssetPopup *popup)
+ : BC_MenuItem(_("Match all"))
+{
+ this->mwindow = mwindow;
+ this->popup = popup;
+}
+int AssetMatchAll::handle_event()
+{
+ popup->match_all();
+ return 1;
+}
+AssetPopupProjectRemove::AssetPopupProjectRemove(MWindow *mwindow, AssetPopup *popup)
+ : BC_MenuItem(_("Remove from project"))
+{
+ this->mwindow = mwindow;
+ this->popup = popup;
+}
+AssetPopupProjectRemove::~AssetPopupProjectRemove()
+{
+}
+int AssetPopupProjectRemove::handle_event()
+{
+ mwindow->remove_assets_from_project(1,
+ 1,
+ mwindow->session->drag_assets,
+ mwindow->session->drag_clips);
+ return 1;
+}
-AssetMatchAll::AssetMatchAll(MWindow *mwindow, AssetPopup *popup)
- : BC_MenuItem(_("Match all"))
+AssetPopupDiskRemove::AssetPopupDiskRemove(MWindow *mwindow, AssetPopup *popup)
+ : BC_MenuItem(_("Remove from disk"))
{
this->mwindow = mwindow;
this->popup = popup;
}
-int AssetMatchAll::handle_event()
+
+AssetPopupDiskRemove::~AssetPopupDiskRemove()
{
- popup->match_all();
+}
+
+int AssetPopupDiskRemove::handle_event()
+{
+ mwindow->awindow->asset_remove->start();
return 1;
}
+AssetListMenu::AssetListMenu(MWindow *mwindow, AWindowGUI *gui)
+ : BC_PopupMenu(0, 0, 0, "", 0)
+{
+ this->mwindow = mwindow;
+ this->gui = gui;
+}
+AssetListMenu::~AssetListMenu()
+{
+}
+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));
+ update_titles();
+}
+void AssetListMenu::update_titles()
+{
+ format->update();
+}
+AssetListCopy::AssetListCopy(MWindow *mwindow)
+ : BC_MenuItem(_("Copy file list"))
+{
+ this->mwindow = mwindow;
+ copy_dialog = 0;
+}
+AssetListCopy::~AssetListCopy()
+{
+ delete copy_dialog;
+}
+int AssetListCopy::handle_event()
+{
+ int len = 0;
+ MWindowGUI *gui = mwindow->gui;
+ gui->lock_window("AssetListCopy::handle_event");
+ mwindow->awindow->gui->collect_assets();
+ int n = mwindow->session->drag_assets->total;
+ for( int i=0; i<n; ++i ) {
+ Indexable *indexable = mwindow->session->drag_assets->values[i];
+ const char *path = indexable->path;
+ if( !*path ) continue;
+ len += strlen(path) + 1;
+ }
+ char *text = new char[len+1], *cp = text;
+ for( int i=0; i<n; ++i ) {
+ Indexable *indexable = mwindow->session->drag_assets->values[i];
+ const char *path = indexable->path;
+ if( !*path ) continue;
+ cp += sprintf(cp, "%s\n", path);
+ }
+ *cp = 0;
+ gui->unlock_window();
+ if( n ) {
+ if( !copy_dialog )
+ copy_dialog = new AssetCopyDialog(this);
+ copy_dialog->start(text);
+ }
+ else {
+ eprintf(_("Nothing selected"));
+ delete [] text;
+ }
+ return 1;
+}
+AssetCopyDialog::AssetCopyDialog(AssetListCopy *copy)
+ : BC_DialogThread()
+{
+ this->copy = copy;
+ copy_window = 0;
+}
+void AssetCopyDialog::start(char *text)
+{
+ close_window();
+ this->text = text;
+ BC_DialogThread::start();
+}
+AssetCopyDialog::~AssetCopyDialog()
+{
+ close_window();
+}
+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->create_objects();
+ return copy_window;
+}
-AssetPopupProjectRemove::AssetPopupProjectRemove(MWindow *mwindow, AssetPopup *popup)
- : BC_MenuItem(_("Remove from project"))
+void AssetCopyDialog::handle_done_event(int result)
{
- this->mwindow = mwindow;
- this->popup = popup;
+ delete [] text; text = 0;
}
+void AssetCopyDialog::handle_close_event(int result)
+{
+ copy_window = 0;
+}
-AssetPopupProjectRemove::~AssetPopupProjectRemove()
+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)
{
+ this->copy_dialog = copy_dialog;
}
-int AssetPopupProjectRemove::handle_event()
+AssetCopyWindow::~AssetCopyWindow()
{
- mwindow->remove_assets_from_project(1,
- 1,
- mwindow->session->drag_assets,
- mwindow->session->drag_clips);
- return 1;
}
+void 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:")));
+ y += title->get_h() + pad;
+ int text_w = get_w() - x - 10;
+ int text_h = get_h() - y - BC_OKButton::calculate_h() - pad;
+ int text_rows = BC_TextBox::pixels_to_rows(this, MEDIUMFONT, text_h);
+ char *text = copy_dialog->text;
+ int len = strlen(text) + BCTEXTLEN;
+ file_list = new BC_ScrollTextBox(this, x, y, text_w, text_rows, text, len);
+ file_list->create_objects();
+ add_subwindow(new BC_OKButton(this));
+ show_window();
+}
-AssetPopupDiskRemove::AssetPopupDiskRemove(MWindow *mwindow, AssetPopup *popup)
- : BC_MenuItem(_("Remove from disk"))
+AssetListPaste::AssetListPaste(MWindow *mwindow)
+ : BC_MenuItem(_("Paste file list"))
{
this->mwindow = mwindow;
- this->popup = popup;
+ paste_dialog = 0;
+}
+AssetListPaste::~AssetListPaste()
+{
+ delete paste_dialog;
}
+int AssetListPaste::handle_event()
+{
+ if( !paste_dialog )
+ paste_dialog = new AssetPasteDialog(this);
+ paste_dialog->start();
+ return 1;
+}
-AssetPopupDiskRemove::~AssetPopupDiskRemove()
+AssetPasteDialog::AssetPasteDialog(AssetListPaste *paste)
+ : BC_DialogThread()
{
+ this->paste = paste;
+ paste_window = 0;
}
+AssetPasteDialog::~AssetPasteDialog()
+{
+ close_window();
+}
-int AssetPopupDiskRemove::handle_event()
+BC_Window* AssetPasteDialog::new_gui()
{
- mwindow->awindow->asset_remove->start();
- return 1;
+ 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->create_objects();
+ return paste_window;
+}
+
+void AssetPasteDialog::handle_done_event(int result)
+{
+ if( result ) return;
+ const char *bp = paste_window->file_list->get_text(), *ep = bp+strlen(bp);
+ ArrayList<char*> path_list;
+ path_list.set_array_delete();
+
+ for( const char *cp=bp; cp<ep && *cp; ) {
+ const char *dp = strchr(cp, '\n');
+ if( !dp ) dp = ep;
+ char path[BCTEXTLEN], *pp = path;
+ int len = sizeof(path)-1;
+ while( --len>0 && cp<dp ) *pp++ = *cp++;
+ if( *cp ) ++cp;
+ *pp = 0;
+ if( !strlen(path) ) continue;
+ path_list.append(cstrdup(path));
+ }
+ if( !path_list.size() ) return;
+
+ MWindow *mwindow = paste->mwindow;
+ mwindow->interrupt_indexes();
+ mwindow->gui->lock_window("AssetPasteDialog::handle_done_event");
+ result = mwindow->load_filenames(&path_list, LOADMODE_RESOURCESONLY, 0);
+ mwindow->gui->unlock_window();
+ path_list.remove_all_objects();
+ mwindow->save_backup();
+ mwindow->restart_brender();
+ mwindow->session->changes_made = 1;
}
+void AssetPasteDialog::handle_close_event(int result)
+{
+ paste_window = 0;
+}
+
+
+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)
+{
+ this->paste_dialog = paste_dialog;
+}
+AssetPasteWindow::~AssetPasteWindow()
+{
+}
+void 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:")));
+ y += title->get_h() + pad;
+ int text_w = get_w() - x - 10;
+ int text_h = get_h() - y - BC_OKButton::calculate_h() - pad;
+ int text_rows = BC_TextBox::pixels_to_rows(this, MEDIUMFONT, text_h);
+ file_list = new BC_ScrollTextBox(this, x, y, text_w, text_rows, (char*)0, 65536);
+ file_list->create_objects();
+ add_subwindow(new BC_OKButton(this));
+ add_subwindow(new BC_CancelButton(this));
+ show_window();
+}
#ifndef ASSETPOPUP_H
#define ASSETPOPUP_H
-class AssetPopupInfo;
-class AssetPopupBuildIndex;
-class AssetPopupView;
-class AssetPopupViewWindow;
-
#include "assetedit.inc"
+#include "assetpopup.inc"
#include "awindowgui.inc"
-#include "awindowmenu.inc"
#include "edl.inc"
#include "guicast.h"
#include "assets.inc"
AssetPopupBuildIndex *index;
AssetPopupView *view;
AssetPopupViewWindow *view_window;
- AssetListFormat *format;
+ AWindowListFormat *format;
};
class AssetPopupInfo : public BC_MenuItem
AssetPopup *popup;
};
+class AssetListMenu : public BC_PopupMenu
+{
+public:
+ AssetListMenu(MWindow *mwindow, AWindowGUI *gui);
+ ~AssetListMenu();
+
+ void create_objects();
+ void update_titles();
+
+ MWindow *mwindow;
+ AWindowGUI *gui;
+ AWindowListFormat *format;
+};
+
+class AssetListCopy : public BC_MenuItem
+{
+public:
+ AssetListCopy(MWindow *mwindow);
+ ~AssetListCopy();
+
+ int handle_event();
+
+ MWindow *mwindow;
+ AssetCopyDialog *copy_dialog;
+};
+
+class AssetCopyDialog : public BC_DialogThread
+{
+public:
+ AssetCopyDialog(AssetListCopy *copy);
+ ~AssetCopyDialog();
+
+ void start(char *text);
+ BC_Window* new_gui();
+ void handle_done_event(int result);
+ void handle_close_event(int result);
+
+ char *text;
+ AssetListCopy *copy;
+ AssetCopyWindow *copy_window;
+};
+
+class AssetCopyWindow : public BC_Window
+{
+public:
+ AssetCopyWindow(AssetCopyDialog *copy_dialog, int x, int y);
+ ~AssetCopyWindow();
+
+ void create_objects();
+
+ AssetCopyDialog *copy_dialog;
+ BC_ScrollTextBox *file_list;
+};
+
+class AssetListPaste : public BC_MenuItem
+{
+public:
+ AssetListPaste(MWindow *mwindow);
+ ~AssetListPaste();
+
+ int handle_event();
+
+ MWindow *mwindow;
+ AssetPasteDialog *paste_dialog;
+};
+
+class AssetPasteDialog : public BC_DialogThread
+{
+public:
+ AssetPasteDialog(AssetListPaste *paste);
+ ~AssetPasteDialog();
+
+ BC_Window* new_gui();
+ void handle_done_event(int result);
+ void handle_close_event(int result);
+
+ AssetListPaste *paste;
+ AssetPasteWindow *paste_window;
+};
+
+class AssetPasteWindow : public BC_Window
+{
+public:
+ AssetPasteWindow(AssetPasteDialog *paste_dialog, int x, int y);
+ ~AssetPasteWindow();
+
+ void create_objects();
+
+ AssetPasteDialog *paste_dialog;
+ BC_ScrollTextBox *file_list;
+};
#endif
#define ASSETPOPUP_INC
class AssetPopup;
+class AssetPopupInfo;
+class AssetPopupSort;
+class AssetPopupBuildIndex;
+class AssetPopupView;
+class AssetPopupViewWindow;
+class AssetPopupPaste;
+class AssetMatchSize;
+class AssetMatchRate;
+class AssetMatchAll;
+class AssetPopupProjectRemove;
+class AssetPopupDiskRemove;
+class AssetListMenu;
+class AssetListCopy;
+class AssetCopyDialog;
+class AssetCopyWindow;
+class AssetListPaste;
+class AssetPasteDialog;
+class AssetPasteWindow;
#endif
{
Asset *new_asset = new Asset(path);
new_asset->read(file);
- Asset *asset = update(new_asset);
- asset->copy_from(new_asset,1);
+ update(new_asset);
new_asset->Garbage::remove_user();
}
}
}
}
-Assets& Assets::operator=(Assets &assets)
-{
-printf("Assets::operator= 1\n");
- copy_from(&assets);
- return *this;
-}
-
-
void Assets::update_index(Asset *asset)
{
if(!asset) return;
Assets(EDL *edl);
virtual ~Assets();
- int load(FileXML *xml,
- uint32_t load_flags);
- int save(FileXML *xml,
- char *output_path);
- Assets& operator=(Assets &assets);
+ int load(FileXML *xml, uint32_t load_flags);
+ int save(FileXML *xml, char *output_path);
void copy_from(Assets *assets);
// Enter a new asset into the table.
// Update the index information for assets with the same path
void update_index(Asset *asset);
-
// Parent EDL
EDL *edl;
-
-
-
-
-
-
-
-
int delete_all();
int dump(FILE *fp=stdout);
int update_old_filename(char *old_filename, char *new_filename);
};
-
-
-
#endif
#include "bcsignals.h"
#include "clipedit.h"
#include "labeledit.h"
+#include "labelpopup.h"
AWindow::AWindow(MWindow *mwindow)
: Thread(1, 0, 0)
#include "bcwindowbase.inc"
#include "clipedit.inc"
#include "labeledit.inc"
+#include "labelpopup.inc"
#include "mwindow.inc"
#include "thread.h"
#include "assetpopup.h"
#include "assets.h"
#include "awindowgui.h"
-#include "awindowgui.inc"
#include "awindow.h"
-#include "awindowmenu.h"
#include "bcsignals.h"
#include "bchash.h"
#include "cache.h"
#include "bccmodels.h"
+#include "clippopup.h"
#include "cursors.h"
#include "cwindowgui.h"
#include "cwindow.h"
#include "edlsession.h"
#include "file.h"
#include "filesystem.h"
+#include "folderlistmenu.h"
#include "indexable.h"
#include "keys.h"
#include "language.h"
#include "labels.h"
-#include "labeledit.h"
+#include "labelpopup.h"
#include "localsession.h"
#include "mainmenu.h"
#include "mainsession.h"
{
if( vicon )
gui->vicon_thread->del_vicon(vicon);
- if(indexable) indexable->remove_user();
- if(edl) edl->remove_user();
+ if( indexable ) indexable->remove_user();
+ if( edl ) edl->remove_user();
if( icon && !gui->protected_pixmap(icon) ) {
delete icon;
if( !plugin ) delete icon_vframe;
pixmap_h = 50 * BC_WindowBase::get_resources()->icon_scale;
- if(debug) printf("AssetPicon::create_objects %d\n", __LINE__);
- if(indexable)
- {
+ if( debug ) printf("AssetPicon::create_objects %d\n", __LINE__);
+ if( indexable ) {
fs.extract_name(name, indexable->path);
set_text(name);
}
- if(indexable && indexable->is_asset)
- {
- if(debug) printf("AssetPicon::create_objects %d\n", __LINE__);
+ if( indexable && indexable->is_asset ) {
+ if( debug ) printf("AssetPicon::create_objects %d\n", __LINE__);
Asset *asset = (Asset*)indexable;
- if(asset->video_data)
- {
- if(mwindow->preferences->use_thumbnails)
- {
+ if( asset->video_data ) {
+ if( mwindow->preferences->use_thumbnails ) {
gui->unlock_window();
- if(debug) printf("AssetPicon::create_objects %d\n", __LINE__);
+ if( debug ) printf("AssetPicon::create_objects %d\n", __LINE__);
File *file = mwindow->video_cache->check_out(asset,
mwindow->edl,
1);
- if(debug) printf("AssetPicon::create_objects %d\n", __LINE__);
+ if( debug ) printf("AssetPicon::create_objects %d\n", __LINE__);
- if(file)
- {
+ if( file ) {
int height = asset->height > 0 ? asset->height : 1;
pixmap_w = pixmap_h * asset->width / height;
file->set_layer(0);
file->set_video_position(0, 0);
- if(gui->temp_picon &&
+ if( gui->temp_picon &&
(gui->temp_picon->get_w() != asset->width ||
- gui->temp_picon->get_h() != asset->height))
- {
+ gui->temp_picon->get_h() != asset->height) ) {
delete gui->temp_picon;
gui->temp_picon = 0;
}
- if(!gui->temp_picon)
- {
+ if( !gui->temp_picon ) {
gui->temp_picon = new VFrame(0, -1,
asset->width, asset->height,
BC_RGB888, -1);
}
file->read_frame(gui->temp_picon);
- if(debug) printf("AssetPicon::create_objects %d\n", __LINE__);
+ if( debug ) printf("AssetPicon::create_objects %d\n", __LINE__);
mwindow->video_cache->check_in(asset);
gui->lock_window("AssetPicon::create_objects 1");
int64_t length = secs * gui->vicon_thread->refresh_rate;
vicon = new AssetVIcon(this, pixmap_w, pixmap_h, framerate, length);
gui->vicon_thread->add_vicon(vicon);
- if(debug) printf("AssetPicon::create_objects %d\n", __LINE__);
+ if( debug ) printf("AssetPicon::create_objects %d\n", __LINE__);
}
- else
- {
+ else {
gui->lock_window("AssetPicon::create_objects 2");
icon = gui->video_icon;
icon_vframe = BC_WindowBase::get_resources()->type_to_icon[ICON_FILM];
}
}
- else
- {
+ else {
icon = gui->video_icon;
icon_vframe = BC_WindowBase::get_resources()->type_to_icon[ICON_FILM];
}
}
else
- if(asset->audio_data)
- {
+ if( asset->audio_data ) {
icon = gui->audio_icon;
icon_vframe = BC_WindowBase::get_resources()->type_to_icon[ICON_SOUND];
}
//printf("AssetPicon::create_objects 2\n");
- if(debug) printf("AssetPicon::create_objects %d\n", __LINE__);
+ if( debug ) printf("AssetPicon::create_objects %d\n", __LINE__);
}
else
- if(indexable && !indexable->is_asset)
- {
+ if( indexable && !indexable->is_asset ) {
icon = gui->video_icon;
icon_vframe = BC_WindowBase::get_resources()->type_to_icon[ICON_FILM];
}
else
- if(edl)
- {
+ if( edl ) {
//printf("AssetPicon::create_objects 4 %s\n", edl->local_session->clip_title);
set_text(strcpy(name, edl->local_session->clip_title));
icon = gui->clip_icon;
icon_vframe = mwindow->theme->get_image("clip_icon");
}
else
- if(plugin)
- {
+ if( plugin ) {
strcpy(name, _(plugin->title));
set_text(name);
icon_vframe = plugin->get_picon();
}
}
else
- if(label) {
+ if( label ) {
Units::totext(name,
label->position,
mwindow->edl->session->time_format,
mwindow->edl->session->frame_rate,
mwindow->edl->session->frames_per_foot);
set_text(name);
- icon = gui->file_icon;
- icon_vframe = BC_WindowBase::get_resources()->type_to_icon[ICON_UNKNOWN];
+ icon = gui->label_icon;
+ icon_vframe = BC_WindowBase::get_resources()->type_to_icon[ICON_LABEL];
set_icon(icon);
set_icon_vframe(icon_vframe);
}
set_icon(icon);
set_icon_vframe(icon_vframe);
- if(debug) printf("AssetPicon::create_objects %d\n", __LINE__);
+ if( debug ) printf("AssetPicon::create_objects %d\n", __LINE__);
}
video_icon = 0;
folder_icon = 0;
clip_icon = 0;
+ label_icon = 0;
atransition_icon = 0; atransition_vframe = 0;
vtransition_icon = 0; vtransition_vframe = 0;
aeffect_icon = 0; aeffect_vframe = 0;
newfolder_thread = 0;
asset_menu = 0;
assetlist_menu = 0;
+ cliplist_menu = 0;
+ labellist_menu = 0;
folderlist_menu = 0;
temp_picon = 0;
allow_iconlisting = 1;
delete video_icon;
delete folder_icon;
delete clip_icon;
+ delete label_icon;
delete atransition_icon;
delete vtransition_icon;
delete aeffect_icon;
delete veffect_icon;
delete newfolder_thread;
delete asset_menu;
+ delete clip_menu;
delete label_menu;
delete assetlist_menu;
+ delete cliplist_menu;
+ delete labellist_menu;
delete folderlist_menu;
- if(temp_picon) delete temp_picon;
+ if( temp_picon ) delete temp_picon;
delete remove_plugin;
}
icon == audio_icon ||
icon == video_icon ||
icon == clip_icon ||
+ icon == label_icon ||
icon == vtransition_icon ||
icon == atransition_icon ||
icon == veffect_icon ||
BC_WindowBase::get_resources()->type_to_icon[ICON_FILM],
PIXMAP_ALPHA);
+ label_icon = new BC_Pixmap(this,
+ BC_WindowBase::get_resources()->type_to_icon[ICON_LABEL],
+ PIXMAP_ALPHA);
+
SET_TRACE
clip_vframe = mwindow->theme->get_image("clip_icon");
add_subwindow(asset_menu = new AssetPopup(mwindow, this));
asset_menu->create_objects();
-
+ add_subwindow(clip_menu = new ClipPopup(mwindow, this));
+ clip_menu->create_objects();
add_subwindow(label_menu = new LabelPopup(mwindow, this));
label_menu->create_objects();
-SET_TRACE
-
add_subwindow(assetlist_menu = new AssetListMenu(mwindow, this));
-
-SET_TRACE
assetlist_menu->create_objects();
-
+ add_subwindow(cliplist_menu = new ClipListMenu(mwindow, this));
+ cliplist_menu->create_objects();
+ add_subwindow(labellist_menu = new LabelListMenu(mwindow, this));
+ labellist_menu->create_objects();
SET_TRACE
add_subwindow(folderlist_menu = new FolderListMenu(mwindow, this));
folderlist_menu->create_objects();
+SET_TRACE
//printf("AWindowGUI::create_objects 2\n");
-SET_TRACE
create_custom_xatoms();
unlock_window();
}
int AWindowGUI::keypress_event()
{
- switch(get_keypress()) {
+ switch( get_keypress() ) {
case 'w': case 'W':
- if(ctrl_down()) {
+ if( ctrl_down() ) {
close_event();
return 1;
}
break;
case DELETE:
- if(shift_down()) {
+ if( shift_down() ) {
PluginServer* plugin = selected_plugin();
if( !plugin ) break;
remove_plugin = new AWindowRemovePlugin(awindow, plugin);
{
stop_vicon_drawing();
//printf("AWindowGUI::update_folder_list 1\n");
- for(int i = 0; i < folders.total; i++)
- {
+ for( int i = 0; i < folders.total; i++ ) {
AssetPicon *picon = (AssetPicon*)folders.values[i];
picon->in_use--;
}
//printf("AWindowGUI::update_folder_list 1\n");
// Search assets for folders
- for(int i = 0; i < mwindow->edl->folders.total; i++)
- {
+ for( int i = 0; i < mwindow->edl->folders.total; i++ ) {
const char *folder = mwindow->edl->folders.values[i];
int exists = 0;
//printf("AWindowGUI::update_folder_list 1.1\n");
- for(int j = 0; j < folders.total; j++)
- {
+ for( int j = 0; j < folders.total; j++ ) {
AssetPicon *picon = (AssetPicon*)folders.values[j];
- if(!strcasecmp(picon->get_text(), folder))
- {
+ if( !strcasecmp(picon->get_text(), folder) ) {
exists = 1;
picon->in_use = 1;
break;
}
}
- if(!exists)
- {
+ if( !exists ) {
int aw_folder = folder_number(folder);
AssetPicon *picon = aw_folder >= 0 ?
new AssetPicon(mwindow, this, aw_folder) :
//printf("AWindowGUI::update_folder_list 1.3\n");
}
//printf("AWindowGUI::update_folder_list 1\n");
-//for(int i = 0; i < folders.total; i++)
+//for( int i = 0; i < folders.total; i++ )
// printf("AWindowGUI::update_folder_list %s\n", folders.values[i]->get_text());
// Delete excess
- for(int i = folders.total - 1; i >= 0; i--)
- {
+ for( int i = folders.total - 1; i >= 0; i-- ) {
AssetPicon *picon = (AssetPicon*)folders.values[i];
- if(!picon->in_use && !picon->persistent)
- {
+ if( !picon->in_use && !picon->persistent ) {
delete picon;
folders.remove_number(i);
}
}
-//for(int i = 0; i < folders.total; i++)
+//for( int i = 0; i < folders.total; i++ )
// printf("AWindowGUI::update_folder_list %s\n", folders.values[i]->get_text());
//printf("AWindowGUI::update_folder_list 2\n");
start_vicon_drawing();
mwindow->search_plugindb(do_audio, do_video, is_realtime, is_transition,
0, plugin_list);
- for(int i = 0; i < plugin_list.total; i++) {
+ for( int i = 0; i < plugin_list.total; i++ ) {
PluginServer *server = plugin_list.values[i];
int visible = plugin_visibility & (1<<server->dir_idx);
- if(!visible) continue;
+ if( !visible ) continue;
// Create new listitem
AssetPicon *picon = new AssetPicon(mwindow, this, server);
picon->create_objects();
void AWindowGUI::create_label_folder()
{
Label *current;
- for(current = mwindow->edl->labels->first; current; current = NEXT) {
+ for( current = mwindow->edl->labels->first; current; current = NEXT ) {
AssetPicon *picon = new AssetPicon(mwindow, this, current);
picon->create_objects();
labellist.append(picon);
void AWindowGUI::update_asset_list()
{
//printf("AWindowGUI::update_asset_list 1\n");
- for(int i = 0; i < assets.total; i++)
- {
+ for( int i = 0; i < assets.total; i++ ) {
AssetPicon *picon = (AssetPicon*)assets.values[i];
picon->in_use--;
}
// Synchronize EDL clips
- for(int i = 0; i < mwindow->edl->clips.total; i++)
- {
+ for( int i = 0; i < mwindow->edl->clips.total; i++ ) {
int exists = 0;
// Look for clip in existing listitems
- for(int j = 0; j < assets.total && !exists; j++)
- {
+ for( int j = 0; j < assets.total && !exists; j++ ) {
AssetPicon *picon = (AssetPicon*)assets.values[j];
- if(picon->id == mwindow->edl->clips.values[i]->id)
- {
+ if( picon->id == mwindow->edl->clips.values[i]->id ) {
picon->edl = mwindow->edl->clips.values[i];
picon->set_text(mwindow->edl->clips.values[i]->local_session->clip_title);
exists = 1;
}
// Create new listitem
- if(!exists)
- {
+ if( !exists ) {
AssetPicon *picon = new AssetPicon(mwindow,
this,
mwindow->edl->clips.values[i]);
// Synchronize EDL assets
- for(Asset *current = mwindow->edl->assets->first;
+ for( Asset *current = mwindow->edl->assets->first;
current;
- current = NEXT)
- {
+ current = NEXT ) {
int exists = 0;
// Look for asset in existing listitems
- for(int j = 0; j < assets.total && !exists; j++)
- {
+ for( int j = 0; j < assets.total && !exists; j++ ) {
AssetPicon *picon = (AssetPicon*)assets.values[j];
- if(picon->id == current->id)
- {
+ if( picon->id == current->id ) {
picon->indexable = current;
exists = 1;
picon->in_use = 1;
}
// Create new listitem
- if(!exists)
- {
+ if( !exists ) {
//printf("AWindowGUI::update_asset_list %d\n", __LINE__);
AssetPicon *picon = new AssetPicon(mwindow, this, current);
//printf("AWindowGUI::update_asset_list %d\n", __LINE__);
// Synchronize nested EDLs
- for(int i = 0; i < mwindow->edl->nested_edls->size(); i++)
- {
+ for( int i = 0; i < mwindow->edl->nested_edls->size(); i++ ) {
int exists = 0;
Indexable *indexable = mwindow->edl->nested_edls->get(i);
// Look for asset in existing listitems
- for(int j = 0; j < assets.total && !exists; j++)
- {
+ for( int j = 0; j < assets.total && !exists; j++ ) {
AssetPicon *picon = (AssetPicon*)assets.values[j];
- if(picon->id == indexable->id)
- {
+ if( picon->id == indexable->id ) {
picon->indexable = indexable;
exists = 1;
picon->in_use = 1;
}
// Create new listitem
- if(!exists)
- {
+ if( !exists ) {
AssetPicon *picon = new AssetPicon(mwindow,
this,
indexable);
//printf("AWindowGUI::update_asset_list %d\n", __LINE__);
- for(int i = assets.size() - 1; i >= 0; i--)
- {
+ for( int i = assets.size() - 1; i >= 0; i-- ) {
AssetPicon *picon = (AssetPicon*)assets.get(i);
//printf("AWindowGUI::update_asset_list %s %d\n", picon->asset->path, picon->in_use);
- if(!picon->in_use)
- {
+ if( !picon->in_use ) {
delete picon;
assets.remove_number(i);
}
{
//printf("AWindowGUI::update_asset_list 1\n");
VIcon *vicon = 0;
- for(int i = 0; i < assets.total; i++) {
+ for( int i = 0; i < assets.total; i++ ) {
AssetPicon *picon = (AssetPicon*)assets.values[i];
if( picon->indexable == indexable ||
picon->edl == (EDL *)indexable ) {
sort_picons(&vtransitions);
break;
case AW_LABEL_FOLDER:
- // Labels should ALWAYS be sorted by time
+ sort_picons(&labellist);
break;
default:
sort_picons(&assets);
while(1)
{
AssetPicon *result = (AssetPicon*)asset_list->get_selection(0, i++);
- if(!result) break;
+ if( !result ) break;
- if(result->indexable) mwindow->session->drag_assets->append(result->indexable);
- if(result->edl) mwindow->session->drag_clips->append(result->edl);
+ if( result->indexable ) mwindow->session->drag_assets->append(result->indexable);
+ if( result->edl ) mwindow->session->drag_clips->append(result->edl);
}
}
dst[1].remove_all_objects();
// Create new pointers
-//if(folder) printf("AWindowGUI::copy_picons 1 %s\n", folder);
- for(int i = 0; i < src->total; i++)
- {
+//if( folder ) printf("AWindowGUI::copy_picons 1 %s\n", folder);
+ for( int i = 0; i < src->total; i++ ) {
AssetPicon *picon = (AssetPicon*)src->values[i];
//printf("AWindowGUI::copy_picons 2 %s\n", picon->asset->folder);
if( folder < 0 ||
(picon->edl && picon->edl->local_session->awindow_folder == folder) ) {
BC_ListBoxItem *item2, *item1;
dst[0].append(item1 = picon);
- if(picon->edl)
+ if( picon->edl )
dst[1].append(item2 = new BC_ListBoxItem(picon->edl->local_session->clip_notes));
else
- if(picon->label && picon->label->textstr)
+ if( picon->label && picon->label->textstr )
dst[1].append(item2 = new BC_ListBoxItem(picon->label->textstr));
else
dst[1].append(item2 = new BC_ListBoxItem(""));
while(!done)
{
done = 1;
- for(int i = 0; i < src->total - 1; i++)
- {
+ for( int i = 0; i < src->total - 1; i++ ) {
BC_ListBoxItem *item1 = src->values[i];
BC_ListBoxItem *item2 = src->values[i + 1];
item1->set_autoplace_icon(1);
item2->set_autoplace_icon(1);
item1->set_autoplace_text(1);
item2->set_autoplace_text(1);
- if(strcmp(item1->get_text(), item2->get_text()) > 0)
- {
+ if( strcmp(item1->get_text(), item2->get_text()) > 0 ) {
src->values[i + 1] = item1;
src->values[i] = item2;
done = 0;
void AWindowGUI::filter_displayed_assets()
{
- allow_iconlisting = 1;
+ //allow_iconlisting = 1;
asset_titles[0] = _("Title");
asset_titles[1] = _("Comments");
copy_picons(displayed_assets, &labellist, AW_NO_FOLDER);
asset_titles[0] = _("Time Stamps");
asset_titles[1] = _("Title");
- allow_iconlisting = 0;
+ //allow_iconlisting = 0;
break;
default:
copy_picons(displayed_assets, &assets, mwindow->edl->session->awindow_folder);
}
// Ensure the current folder icon is highlighted
- for(int i = 0; i < folders.total; i++)
+ for( int i = 0; i < folders.total; i++ )
folders.values[i]->set_selected(0);
folders.values[mwindow->edl->session->awindow_folder]->set_selected(1);
//printf("AWindowGUI::update_assets 3\n");
filter_displayed_assets();
-//for(int i = 0; i < folders.total; i++)
+//for( int i = 0; i < folders.total; i++ )
//printf("AWindowGUI::update_assets 4\n");
// printf("AWindowGUI::update_assets %s\n", folders.values[i]->get_text());
- if(mwindow->edl->session->folderlist_format != folder_list->get_format())
+ if( mwindow->edl->session->folderlist_format != folder_list->get_format() )
folder_list->update_format(mwindow->edl->session->folderlist_format, 0);
- folder_list->update(&folders,
- 0,
- 0,
- 1,
+ folder_list->update(&folders, 0, 0, 1,
folder_list->get_xposition(),
folder_list->get_yposition(),
-1);
//printf("AWindowGUI::update_assets 5\n");
- if(mwindow->edl->session->assetlist_format != asset_list->get_format())
+ if( mwindow->edl->session->assetlist_format != asset_list->get_format() )
asset_list->update_format(mwindow->edl->session->assetlist_format, 0);
//printf("AWindowGUI::update_assets 6 %d\n", displayed_assets[0].total);
- asset_list->update(displayed_assets,
- asset_titles,
- mwindow->edl->session->asset_columns,
- ASSET_COLUMNS,
+ asset_list->update(displayed_assets, asset_titles,
+ mwindow->edl->session->asset_columns, ASSET_COLUMNS,
asset_list->get_xposition(),
asset_list->get_yposition(),
- -1,
- 0);
+ -1, 0);
asset_list->center_selection();
//printf("AWindowGUI::update_assets 7\n");
int AWindowGUI::folder_number(const char *name)
{
- for(int i = 0; i < AWINDOW_FOLDERS; i++) {
+ for( int i = 0; i < AWINDOW_FOLDERS; i++ ) {
if( !strcasecmp(name, folder_names[i]) ) return i;
}
return AW_NO_FOLDER;
int AWindowGUI::drag_motion()
{
- if(get_hidden()) return 0;
+ if( get_hidden() ) return 0;
int result = 0;
return result;
int AWindowGUI::drag_stop()
{
- if(get_hidden()) return 0;
+ if( get_hidden() ) return 0;
return 0;
}
int AWindowDivider::button_press_event()
{
- if(is_event_win() && cursor_inside())
- {
+ if( is_event_win() && cursor_inside() ) {
mwindow->session->current_operation = DRAG_PARTITION;
return 1;
}
int AWindowDivider::cursor_motion_event()
{
- if(mwindow->session->current_operation == DRAG_PARTITION)
- {
+ if( mwindow->session->current_operation == DRAG_PARTITION ) {
int wmin = 25;
int wmax = mwindow->session->awindow_w - mwindow->theme->adivider_w - wmin;
int fw = gui->get_relative_cursor_x();
int AWindowDivider::button_release_event()
{
- if(mwindow->session->current_operation == DRAG_PARTITION)
- {
+ if( mwindow->session->current_operation == DRAG_PARTITION ) {
mwindow->session->current_operation = NO_OPERATION;
return 1;
}
int AWindowFolders::selection_changed()
{
AssetPicon *picon = (AssetPicon*)get_selection(0, 0);
- if(picon)
- {
+ if( picon ) {
gui->stop_vicon_drawing();
- if(get_button_down() && get_buttonpress() == 3)
- {
+ if( get_button_down() && get_buttonpress() == 3 ) {
gui->folderlist_menu->update_titles();
gui->folderlist_menu->activate_menu();
}
result = BC_ListBox::button_press_event();
- if(!result)
- {
- if(get_buttonpress() == 3 && is_event_win() && cursor_inside())
- {
+ if( !result ) {
+ if( get_buttonpress() == 3 && is_event_win() && cursor_inside() ) {
gui->folderlist_menu->update_titles();
gui->folderlist_menu->activate_menu();
result = 1;
AWindowAssets::AWindowAssets(MWindow *mwindow, AWindowGUI *gui, int x, int y, int w, int h)
- : BC_ListBox(x,
- y,
- w,
- h,
+ : BC_ListBox(x, y, w, h,
(mwindow->edl->session->assetlist_format == ASSETS_ICONS && gui->allow_iconlisting ) ?
LISTBOX_ICONS : LISTBOX_TEXT,
&gui->assets, // Each column has an ArrayList of BC_ListBoxItems.
result = BC_ListBox::button_press_event();
- if(!result && get_buttonpress() == 3 && is_event_win() && cursor_inside())
- {
+ if( !result && get_buttonpress() == 3 && is_event_win() && cursor_inside() ) {
BC_ListBox::deactivate_selection();
- gui->assetlist_menu->update_titles();
- gui->assetlist_menu->activate_menu();
+ int folder = mwindow->edl->session->awindow_folder;
+ switch( folder ) {
+ case AW_LABEL_FOLDER:
+ gui->labellist_menu->update();
+ gui->labellist_menu->activate_menu();
+ break;
+ case AW_CLIP_FOLDER:
+ gui->cliplist_menu->update();
+ gui->cliplist_menu->activate_menu();
+ break;
+ default:
+ gui->assetlist_menu->update_titles();
+ gui->assetlist_menu->activate_menu();
+ break;
+ }
result = 1;
}
int AWindowAssets::selection_changed()
{
// Show popup window
- if( get_button_down() && get_buttonpress() == 3 && get_selection(0, 0) ) {
- switch( mwindow->edl->session->awindow_folder ) {
+ AssetPicon *item;
+ if( get_button_down() && get_buttonpress() == 3 &&
+ (item = (AssetPicon*)get_selection(0, 0)) ) {
+ int folder = mwindow->edl->session->awindow_folder;
+ switch( folder ) {
case AW_AEFFECT_FOLDER:
case AW_VEFFECT_FOLDER:
case AW_ATRANSITION_FOLDER:
gui->assetlist_menu->activate_menu();
break;
case AW_LABEL_FOLDER:
- if(((AssetPicon*)get_selection(0, 0))->label)
- gui->label_menu->activate_menu();
+ if( !item->label ) break;
+ gui->label_menu->activate_menu();
+ break;
+ case AW_CLIP_FOLDER:
+ if( !item->indexable && !item->edl ) break;
+ gui->clip_menu->update();
+ gui->clip_menu->activate_menu();
break;
default:
- if(((AssetPicon*)get_selection(0, 0))->indexable)
- gui->asset_menu->update();
- else
- if(((AssetPicon*)get_selection(0, 0))->edl)
- gui->asset_menu->update();
-
+ if( !item->indexable && !item->edl ) break;
+ gui->asset_menu->update();
gui->asset_menu->activate_menu();
+ break;
}
BC_ListBox::deactivate_selection();
return 1;
}
- else if( get_button_down() && get_buttonpress() == 1 && get_selection(0, 0) ) {
+ else if( get_button_down() && get_buttonpress() == 1 &&
+ (item = (AssetPicon*)get_selection(0, 0)) ) {
VIcon *vicon = 0;
if( !gui->vicon_thread->viewing ) {
- AssetPicon *picon = (AssetPicon*)get_selection(0, 0);
- vicon = picon->vicon;
+ vicon = item->vicon;
}
gui->vicon_thread->set_view_popup(vicon);
break;
}
- if(collect_pluginservers)
- {
+ if( collect_pluginservers ) {
int i = 0;
mwindow->session->drag_pluginservers->remove_all();
while(1)
{
AssetPicon *result = (AssetPicon*)get_selection(0, i++);
- if(!result) break;
+ if( !result ) break;
mwindow->session->drag_pluginservers->append(result->plugin);
}
}
- if(collect_assets)
- {
+ if( collect_assets ) {
gui->collect_assets();
}
mwindow->gui->drag_motion();
mwindow->gui->unlock_window();
- for(int i = 0; i < mwindow->vwindows.size(); i++)
- {
+ for( int i = 0; i < mwindow->vwindows.size(); i++ ) {
VWindow *vwindow = mwindow->vwindows.get(i);
if( !vwindow->is_running() ) continue;
vwindow->gui->lock_window("AWindowAssets::drag_motion_event");
unlock_window();
- if(!result)
- {
+ if( !result ) {
mwindow->gui->lock_window("AWindowAssets::drag_stop_event");
result = mwindow->gui->drag_stop();
mwindow->gui->unlock_window();
}
- if(!result)
- {
- for(int i = 0; !result && i < mwindow->vwindows.size(); i++)
- {
+ if( !result ) {
+ for( int i = 0; !result && i < mwindow->vwindows.size(); i++ ) {
VWindow *vwindow = mwindow->vwindows.get(i);
if( !vwindow ) continue;
if( !vwindow->is_running() ) continue;
}
}
- if(!result)
- {
+ if( !result ) {
mwindow->cwindow->gui->lock_window("AWindowAssets::drag_stop_event");
result = mwindow->cwindow->gui->drag_stop();
mwindow->cwindow->gui->unlock_window();
lock_window("AWindowAssets::drag_stop_event");
- if(result) get_drag_popup()->set_animation(0);
+ if( result ) get_drag_popup()->set_animation(0);
BC_ListBox::drag_stop_event();
mwindow->session->current_operation = ::NO_OPERATION; // since NO_OPERATION is also defined in listbox, we have to reach for global scope...
int AWindowDeleteFolder::handle_event()
{
- if(gui->folder_list->get_selection(0, 0))
- {
+ if( gui->folder_list->get_selection(0, 0) ) {
BC_ListBoxItem *folder = gui->folder_list->get_selection(0, 0);
mwindow->delete_folder(folder->get_text());
}
return 1;
}
-
-LabelPopup::LabelPopup(MWindow *mwindow, AWindowGUI *gui)
- : BC_PopupMenu(0,
- 0,
- 0,
- "",
- 0)
-{
- this->mwindow = mwindow;
- this->gui = gui;
-}
-
-LabelPopup::~LabelPopup()
-{
-}
-
-void LabelPopup::create_objects()
-{
- add_item(editlabel = new LabelPopupEdit(mwindow, this));
-}
-
-int LabelPopup::update()
-{
- gui->collect_assets();
- return 0;
-}
-
-
-
-LabelPopupEdit::LabelPopupEdit(MWindow *mwindow, LabelPopup *popup)
- : BC_MenuItem(_("Edit..."))
-{
- this->mwindow = mwindow;
- this->popup = popup;
-}
-
-LabelPopupEdit::~LabelPopupEdit()
-{
-}
-
-int LabelPopupEdit::handle_event()
-{
- int i = 0;
- while(1)
- {
- AssetPicon *result = (AssetPicon*)mwindow->awindow->gui->asset_list->get_selection(0, i++);
- if(!result) break;
-
- if(result->label) {
- mwindow->awindow->gui->awindow->label_edit->edit_label(result->label);
- break;
- }
- }
-
- return 1;
-}
-
AddTools::AddTools(MWindow *mwindow, AWindowGUI *gui, int x, int y, const char *title)
: BC_PopupMenu(x, y, BC_Title::calculate_w(gui, title, MEDIUMFONT)+8, title, -1, 0, 4)
{
return 1;
}
+
+AWindowListFormat::AWindowListFormat(MWindow *mwindow)
+ : BC_MenuItem("")
+{
+ this->mwindow = mwindow;
+}
+
+int AWindowListFormat::handle_event()
+{
+ AWindowGUI *gui = mwindow->awindow->gui;
+ gui->stop_vicon_drawing();
+
+ EDLSession *session = mwindow->edl->session;
+ switch( session->assetlist_format ) {
+ case ASSETS_TEXT:
+ session->assetlist_format = ASSETS_ICONS;
+ break;
+ case ASSETS_ICONS:
+ session->assetlist_format = ASSETS_TEXT;
+ break;
+ }
+
+ gui->asset_list->update_format(session->assetlist_format, 1);
+ if( !mwindow->awindow->gui->allow_iconlisting ) {
+ mwindow->edl->session->assetlist_format = ASSETS_TEXT;
+ }
+
+ gui->start_vicon_drawing();
+ return 1;
+}
+
+void AWindowListFormat::update()
+{
+ set_text(mwindow->edl->session->assetlist_format == ASSETS_TEXT ?
+ (char*)_("Display icons") : (char*)_("Display text"));
+}
+
+AWindowListSort::AWindowListSort(MWindow *mwindow)
+ : BC_MenuItem(_("Sort items"))
+{
+ this->mwindow = mwindow;
+}
+
+int AWindowListSort::handle_event()
+{
+ AWindowGUI *gui = mwindow->awindow->gui;
+ gui->sort_assets();
+ return 1;
+}
+
+
#include "asset.inc"
#include "assets.inc"
#include "awindow.inc"
-#include "awindowmenu.inc"
+#include "awindowgui.inc"
+#include "clippopup.inc"
#include "edl.inc"
+#include "folderlistmenu.inc"
#include "guicast.h"
+#include "labeledit.inc"
+#include "labelpopup.inc"
#include "labels.h"
#include "indexable.inc"
#include "mwindow.inc"
#include "pluginserver.inc"
#include "vicon.h"
-class AWindowAssets;
-class AWindowFolders;
-class AWindowNewFolder;
-class AWindowDeleteFolder;
-class AWindowRenameFolder;
-class AWindowDeleteDisk;
-class AWindowDeleteProject;
-class AWindowDivider;
-class AWindowInfo;
-class AWindowRedrawIndex;
-class AWindowPaste;
-class AWindowAppend;
-class AWindowView;
-class AddTools;
-class AddPluginsMenu;
-class AddPluginItem;
-class AVIconDrawing;
-
-class AssetPicon;
-class AssetVIcon;
-class LabelPopup;
-class LabelPopupEdit;
-class AWindowGUI;
-
class AssetPicon : public BC_ListBoxItem
{
public:
BC_Pixmap *file_icon;
BC_Pixmap *audio_icon;
BC_Pixmap *video_icon;
+ BC_Pixmap *label_icon;
BC_Pixmap *clip_icon; VFrame *clip_vframe;
BC_Pixmap *atransition_icon; VFrame *atransition_vframe;
BC_Pixmap *vtransition_icon; VFrame *vtransition_vframe;
// Popup menus
AssetPopup *asset_menu;
+ ClipPopup *clip_menu;
LabelPopup *label_menu;
AssetListMenu *assetlist_menu;
+ ClipListMenu *cliplist_menu;
+ LabelListMenu *labellist_menu;
FolderListMenu *folderlist_menu;
AddTools *add_tools;
// Temporary for reading picons from files
int x, y;
};
-class LabelPopup : public BC_PopupMenu
-{
-public:
- LabelPopup(MWindow *mwindow, AWindowGUI *gui);
- ~LabelPopup();
-
- void create_objects();
-// Set mainsession with the current selections
- int update();
-
- MWindow *mwindow;
- AWindowGUI *gui;
-
- LabelPopupEdit *editlabel;
-};
-
-class LabelPopupEdit : public BC_MenuItem
-{
-public:
- LabelPopupEdit(MWindow *mwindow, LabelPopup *popup);
- ~LabelPopupEdit();
-
- int handle_event();
-
- MWindow *mwindow;
- LabelPopup *popup;
-};
-
class AddTools : public BC_PopupMenu
{
public:
MWindow *mwindow;
AWindowGUI *gui;
- AddPluginsMenu *add_plugins;
};
class AddPluginItem : public BC_MenuItem
~AVIconDrawing();
};
+
+class AWindowListFormat : public BC_MenuItem
+{
+public:
+ AWindowListFormat(MWindow *mwindow);
+
+ void update();
+ int handle_event();
+ MWindow *mwindow;
+};
+
+
+class AWindowListSort : public BC_MenuItem
+{
+public:
+ AWindowListSort(MWindow *mwindow);
+
+ void update();
+ int handle_event();
+ MWindow *mwindow;
+};
+
#endif
#ifndef AWINDOWGUI_INC
#define AWINDOWGUI_INC
+class AssetPicon;
+class AssetVIcon;
+class AWindowRemovePlugin;
+class AWindowRemovePluginGUI;
+class AWindowRemovePlugin;
class AWindowGUI;
+class AWindowAssets;
+class AWindowDivider;
+class AWindowFolders;
+class AWindowNewFolder;
+class AWindowDeleteFolder;
+class AWindowRenameFolder;
+class AWindowDeleteDisk;
+class AWindowDeleteProject;
+class AWindowInfo;
+class AWindowRedrawIndex;
+class AWindowPaste;
+class AWindowAppend;
+class AWindowView;
+class AddTools;
+class AddPluginItem;
+class AVIconDrawing;
+class AWindowListFormat;
+class AWindowListSort;
#endif
--- /dev/null
+
+/*
+ * CINELERRA
+ * Copyright (C) 1997-2012 Adam Williams <broadcast at earthling dot net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#include "assetedit.h"
+#include "clippopup.h"
+#include "assetremove.h"
+#include "awindow.h"
+#include "awindowgui.h"
+#include "bcsignals.h"
+#include "clipedit.h"
+#include "cwindow.h"
+#include "cwindowgui.h"
+#include "edl.h"
+#include "filexml.h"
+#include "language.h"
+#include "localsession.h"
+#include "mainerror.h"
+#include "mainsession.h"
+#include "mwindow.h"
+#include "mwindowgui.h"
+#include "tracks.h"
+#include "vwindow.h"
+#include "vwindowgui.h"
+
+
+
+ClipPopup::ClipPopup(MWindow *mwindow, AWindowGUI *gui)
+ : BC_PopupMenu(0, 0, 0, "", 0)
+{
+ this->mwindow = mwindow;
+ this->gui = gui;
+}
+
+ClipPopup::~ClipPopup()
+{
+}
+
+void ClipPopup::create_objects()
+{
+ BC_MenuItem *menu_item;
+ BC_SubMenu *submenu;
+ add_item(info = new ClipPopupInfo(mwindow, this));
+ add_item(format = new AWindowListFormat(mwindow));
+ add_item(new ClipPopupSort(mwindow, this));
+ add_item(view = new ClipPopupView(mwindow, this));
+ add_item(view_window = new ClipPopupViewWindow(mwindow, this));
+ add_item(new ClipPopupCopy(mwindow, this));
+ add_item(new ClipPopupPaste(mwindow, this));
+ add_item(menu_item = new BC_MenuItem(_("Match...")));
+ menu_item->add_submenu(submenu = new BC_SubMenu());
+ submenu->add_submenuitem(new ClipMatchSize(mwindow, this));
+ submenu->add_submenuitem(new ClipMatchRate(mwindow, this));
+ submenu->add_submenuitem(new ClipMatchAll(mwindow, this));
+ add_item(menu_item = new BC_MenuItem(_("Remove...")));
+ menu_item->add_submenu(submenu = new BC_SubMenu());
+ submenu->add_submenuitem(new ClipPopupProjectRemove(mwindow, this));
+ submenu->add_submenuitem(new ClipPopupDiskRemove(mwindow, this));
+}
+
+void ClipPopup::paste_assets()
+{
+// Collect items into the drag vectors for temporary storage
+ gui->lock_window("ClipPopup::paste_assets");
+ mwindow->gui->lock_window("ClipPopup::paste_assets");
+ mwindow->cwindow->gui->lock_window("ClipPopup::paste_assets");
+
+ gui->collect_assets();
+ mwindow->paste_assets(mwindow->edl->local_session->get_selectionstart(1),
+ mwindow->edl->tracks->first,
+ 0); // do not overwrite
+
+ gui->unlock_window();
+ mwindow->gui->unlock_window();
+ mwindow->cwindow->gui->unlock_window();
+}
+
+void ClipPopup::match_size()
+{
+// Collect items into the drag vectors for temporary storage
+ gui->collect_assets();
+ mwindow->gui->lock_window("ClipPopup::match_size");
+ mwindow->asset_to_size();
+ mwindow->gui->unlock_window();
+}
+
+void ClipPopup::match_rate()
+{
+// Collect items into the drag vectors for temporary storage
+ gui->collect_assets();
+ mwindow->gui->lock_window("ClipPopup::match_rate");
+ mwindow->asset_to_rate();
+ mwindow->gui->unlock_window();
+}
+
+void ClipPopup::match_all()
+{
+// Collect items into the drag vectors for temporary storage
+ gui->collect_assets();
+ mwindow->gui->lock_window("ClipPopup::match_rate");
+ mwindow->asset_to_all();
+ mwindow->gui->unlock_window();
+}
+
+int ClipPopup::update()
+{
+ format->update();
+ gui->collect_assets();
+ return 0;
+}
+
+
+ClipPopupInfo::ClipPopupInfo(MWindow *mwindow, ClipPopup *popup)
+ : BC_MenuItem(_("Info..."))
+{
+ this->mwindow = mwindow;
+ this->popup = popup;
+}
+
+ClipPopupInfo::~ClipPopupInfo()
+{
+}
+
+int ClipPopupInfo::handle_event()
+{
+ if(mwindow->session->drag_assets->total)
+ {
+ mwindow->awindow->asset_edit->edit_asset(
+ mwindow->session->drag_assets->values[0]);
+ }
+ else
+ if(mwindow->session->drag_clips->total)
+ {
+ popup->gui->awindow->clip_edit->edit_clip(
+ mwindow->session->drag_clips->values[0]);
+ }
+ return 1;
+}
+
+
+ClipPopupSort::ClipPopupSort(MWindow *mwindow, ClipPopup *popup)
+ : BC_MenuItem(_("Sort items"))
+{
+ this->mwindow = mwindow;
+ this->popup = popup;
+}
+
+ClipPopupSort::~ClipPopupSort()
+{
+}
+
+int ClipPopupSort::handle_event()
+{
+ mwindow->awindow->gui->sort_assets();
+ return 1;
+}
+
+
+ClipPopupView::ClipPopupView(MWindow *mwindow, ClipPopup *popup)
+ : BC_MenuItem(_("View"))
+{
+ this->mwindow = mwindow;
+ this->popup = popup;
+}
+
+ClipPopupView::~ClipPopupView()
+{
+}
+
+int ClipPopupView::handle_event()
+{
+ VWindow *vwindow = mwindow->get_viewer(1, DEFAULT_VWINDOW);
+ vwindow->gui->lock_window("ClipPopupView::handle_event");
+
+ if(mwindow->session->drag_assets->total)
+ vwindow->change_source(
+ mwindow->session->drag_assets->values[0]);
+ else
+ if(mwindow->session->drag_clips->total)
+ vwindow->change_source(
+ mwindow->session->drag_clips->values[0]);
+
+ vwindow->gui->unlock_window();
+ return 1;
+}
+
+
+ClipPopupViewWindow::ClipPopupViewWindow(MWindow *mwindow, ClipPopup *popup)
+ : BC_MenuItem(_("View in new window"))
+{
+ this->mwindow = mwindow;
+ this->popup = popup;
+}
+
+ClipPopupViewWindow::~ClipPopupViewWindow()
+{
+}
+
+int ClipPopupViewWindow::handle_event()
+{
+// Find window with nothing
+ VWindow *vwindow = mwindow->get_viewer(1);
+
+// TODO: create new vwindow or change current vwindow
+ vwindow->gui->lock_window("ClipPopupView::handle_event");
+
+ if(mwindow->session->drag_assets->total)
+ vwindow->change_source(
+ mwindow->session->drag_assets->values[0]);
+ else
+ if(mwindow->session->drag_clips->total)
+ vwindow->change_source(
+ mwindow->session->drag_clips->values[0]);
+
+ vwindow->gui->unlock_window();
+ return 1;
+}
+
+
+ClipPopupCopy::ClipPopupCopy(MWindow *mwindow, ClipPopup *popup)
+ : BC_MenuItem(_("Copy"))
+{
+ this->mwindow = mwindow;
+ this->popup = popup;
+}
+ClipPopupCopy::~ClipPopupCopy()
+{
+}
+
+int ClipPopupCopy::handle_event()
+{
+ MWindowGUI *gui = mwindow->gui;
+ gui->lock_window("ClipPopupCopy::handle_event");
+ if( mwindow->session->drag_clips->total > 0 ) {
+ FileXML file;
+ EDL *edl = mwindow->session->drag_clips->values[0];
+ double start = 0, end = edl->tracks->total_length();
+ edl->copy(start, end, 1, 0, 0, &file, "", 1);
+ const char *file_string = file.string();
+ long file_length = strlen(file_string);
+ gui->get_clipboard()->to_clipboard(file_string, file_length,
+ SECONDARY_SELECTION);
+ gui->get_clipboard()->to_clipboard(file_string, file_length,
+ BC_PRIMARY_SELECTION);
+ }
+ gui->unlock_window();
+ return 1;
+}
+
+
+ClipPopupPaste::ClipPopupPaste(MWindow *mwindow, ClipPopup *popup)
+ : BC_MenuItem(_("Paste"))
+{
+ this->mwindow = mwindow;
+ this->popup = popup;
+}
+
+ClipPopupPaste::~ClipPopupPaste()
+{
+}
+
+int ClipPopupPaste::handle_event()
+{
+ popup->paste_assets();
+ return 1;
+}
+
+
+ClipMatchSize::ClipMatchSize(MWindow *mwindow, ClipPopup *popup)
+ : BC_MenuItem(_("Match project size"))
+{
+ this->mwindow = mwindow;
+ this->popup = popup;
+}
+
+int ClipMatchSize::handle_event()
+{
+ popup->match_size();
+ return 1;
+}
+
+
+ClipMatchRate::ClipMatchRate(MWindow *mwindow, ClipPopup *popup)
+ : BC_MenuItem(_("Match frame rate"))
+{
+ this->mwindow = mwindow;
+ this->popup = popup;
+}
+
+int ClipMatchRate::handle_event()
+{
+ popup->match_rate();
+ return 1;
+}
+
+
+ClipMatchAll::ClipMatchAll(MWindow *mwindow, ClipPopup *popup)
+ : BC_MenuItem(_("Match all"))
+{
+ this->mwindow = mwindow;
+ this->popup = popup;
+}
+
+int ClipMatchAll::handle_event()
+{
+ popup->match_all();
+ return 1;
+}
+
+
+ClipPopupProjectRemove::ClipPopupProjectRemove(MWindow *mwindow, ClipPopup *popup)
+ : BC_MenuItem(_("Remove from project"))
+{
+ this->mwindow = mwindow;
+ this->popup = popup;
+}
+
+
+ClipPopupProjectRemove::~ClipPopupProjectRemove()
+{
+}
+
+int ClipPopupProjectRemove::handle_event()
+{
+ mwindow->remove_assets_from_project(1,
+ 1,
+ mwindow->session->drag_assets,
+ mwindow->session->drag_clips);
+ return 1;
+}
+
+
+ClipPopupDiskRemove::ClipPopupDiskRemove(MWindow *mwindow, ClipPopup *popup)
+ : BC_MenuItem(_("Remove from disk"))
+{
+ this->mwindow = mwindow;
+ this->popup = popup;
+}
+
+ClipPopupDiskRemove::~ClipPopupDiskRemove()
+{
+}
+
+int ClipPopupDiskRemove::handle_event()
+{
+ mwindow->awindow->asset_remove->start();
+ return 1;
+}
+
+
+ClipPasteToFolder::ClipPasteToFolder(MWindow *mwindow)
+ : BC_MenuItem(_("Paste Clip"))
+{
+ this->mwindow = mwindow;
+}
+
+int ClipPasteToFolder::handle_event()
+{
+ MWindowGUI *gui = mwindow->gui;
+ gui->lock_window("ClipPasteToFolder::handle_event 1");
+ int64_t len = gui->get_clipboard()->clipboard_len(SECONDARY_SELECTION);
+ if( len ) {
+ char *string = new char[len + 1];
+ gui->get_clipboard()->from_clipboard(string, len, BC_PRIMARY_SELECTION);
+ const char *clip_header = "<EDL VERSION=";
+ if( !strncmp(clip_header, string, strlen(clip_header)) ) {
+ FileXML file;
+ file.read_from_string(string);
+ EDL *edl = mwindow->edl;
+ EDL *new_edl = new EDL(mwindow->edl);
+ new_edl->create_objects();
+ new_edl->load_xml(&file, LOAD_ALL);
+ edl->update_assets(new_edl);
+ mwindow->save_clip(new_edl, _("paste clip: "));
+ }
+ else {
+ char *cp = strchr(string, '\n');
+ if( cp-string < 32 ) *cp = 0;
+ else if( len > 32 ) string[32] = 0;
+ eprintf("paste buffer is not EDL:\n%s", string);
+ }
+ delete [] string;
+ }
+ else {
+ eprintf("paste buffer empty");
+ }
+ gui->unlock_window();
+ return 1;
+}
+
+
+ClipListMenu::ClipListMenu(MWindow *mwindow, AWindowGUI *gui)
+ : BC_PopupMenu(0, 0, 0, "", 0)
+{
+ this->mwindow = mwindow;
+ this->gui = gui;
+}
+
+ClipListMenu::~ClipListMenu()
+{
+}
+
+void ClipListMenu::create_objects()
+{
+ add_item(format = new AWindowListFormat(mwindow));
+ add_item(new AWindowListSort(mwindow));
+ add_item(new ClipPasteToFolder(mwindow));
+ update();
+}
+
+void ClipListMenu::update()
+{
+ format->update();
+}
+
--- /dev/null
+
+/*
+ * CINELERRA
+ * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#ifndef CLIPPOPUP_H
+#define CLIPPOPUP_H
+
+#include "assetedit.inc"
+#include "awindowgui.inc"
+#include "clippopup.inc"
+#include "edl.inc"
+#include "guicast.h"
+#include "assets.inc"
+#include "mwindow.inc"
+
+
+
+class ClipPopup : public BC_PopupMenu
+{
+public:
+ ClipPopup(MWindow *mwindow, AWindowGUI *gui);
+ ~ClipPopup();
+
+ void create_objects();
+// Set mainsession with the current selections
+ int update();
+ void paste_assets();
+ void match_size();
+ void match_rate();
+ void match_all();
+
+ MWindow *mwindow;
+ AWindowGUI *gui;
+
+
+ ClipPopupInfo *info;
+ ClipPopupView *view;
+ ClipPopupViewWindow *view_window;
+ AWindowListFormat *format;
+};
+
+class ClipPopupInfo : public BC_MenuItem
+{
+public:
+ ClipPopupInfo(MWindow *mwindow, ClipPopup *popup);
+ ~ClipPopupInfo();
+
+ int handle_event();
+ int button_press_event();
+
+ MWindow *mwindow;
+ ClipPopup *popup;
+};
+
+class ClipPopupSort : public BC_MenuItem
+{
+public:
+ ClipPopupSort(MWindow *mwindow, ClipPopup *popup);
+ ~ClipPopupSort();
+
+ int handle_event();
+
+ MWindow *mwindow;
+ ClipPopup *popup;
+};
+
+class ClipPopupView : public BC_MenuItem
+{
+public:
+ ClipPopupView(MWindow *mwindow, ClipPopup *popup);
+ ~ClipPopupView();
+
+ int handle_event();
+
+ MWindow *mwindow;
+ ClipPopup *popup;
+};
+
+
+class ClipPopupViewWindow : public BC_MenuItem
+{
+public:
+ ClipPopupViewWindow(MWindow *mwindow, ClipPopup *popup);
+ ~ClipPopupViewWindow();
+
+ int handle_event();
+
+ MWindow *mwindow;
+ ClipPopup *popup;
+};
+
+class ClipPopupCopy : public BC_MenuItem
+{
+public:
+ ClipPopupCopy(MWindow *mwindow, ClipPopup *popup);
+ ~ClipPopupCopy();
+
+ int handle_event();
+
+ MWindow *mwindow;
+ ClipPopup *popup;
+};
+
+class ClipPopupPaste : public BC_MenuItem
+{
+public:
+ ClipPopupPaste(MWindow *mwindow, ClipPopup *popup);
+ ~ClipPopupPaste();
+
+ int handle_event();
+
+ MWindow *mwindow;
+ ClipPopup *popup;
+};
+
+class ClipMatchSize : public BC_MenuItem
+{
+public:
+ ClipMatchSize(MWindow *mwindow, ClipPopup *popup);
+
+ int handle_event();
+
+ MWindow *mwindow;
+ ClipPopup *popup;
+};
+
+class ClipMatchRate : public BC_MenuItem
+{
+public:
+ ClipMatchRate(MWindow *mwindow, ClipPopup *popup);
+
+ int handle_event();
+
+ MWindow *mwindow;
+ ClipPopup *popup;
+};
+
+class ClipMatchAll : public BC_MenuItem
+{
+public:
+ ClipMatchAll(MWindow *mwindow, ClipPopup *popup);
+
+ int handle_event();
+
+ MWindow *mwindow;
+ ClipPopup *popup;
+};
+
+class ClipPopupProjectRemove : public BC_MenuItem
+{
+public:
+ ClipPopupProjectRemove(MWindow *mwindow, ClipPopup *popup);
+ ~ClipPopupProjectRemove();
+
+ int handle_event();
+
+ MWindow *mwindow;
+ ClipPopup *popup;
+};
+
+class ClipPopupDiskRemove : public BC_MenuItem
+{
+public:
+ ClipPopupDiskRemove(MWindow *mwindow, ClipPopup *popup);
+ ~ClipPopupDiskRemove();
+
+ int handle_event();
+
+ MWindow *mwindow;
+ ClipPopup *popup;
+};
+
+class ClipPasteToFolder : public BC_MenuItem
+{
+public:
+ ClipPasteToFolder(MWindow *mwindow);
+
+ int handle_event();
+ MWindow *mwindow;
+};
+
+class ClipListFormat : public BC_MenuItem
+{
+public:
+ ClipListFormat(MWindow *mwindow, ClipListMenu *menu);
+
+ int handle_event();
+ MWindow *mwindow;
+ ClipListMenu *menu;
+};
+
+class ClipListMenu : public BC_PopupMenu
+{
+public:
+ ClipListMenu(MWindow *mwindow, AWindowGUI *gui);
+ ~ClipListMenu();
+
+ void create_objects();
+ void update();
+ AWindowListFormat *format;
+ MWindow *mwindow;
+ AWindowGUI *gui;
+};
+
+#endif
--- /dev/null
+
+/*
+ * CINELERRA
+ * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#ifndef CLIPPOPUP_INC
+#define CLIPPOPUP_INC
+
+class ClipPopup;
+class ClipPopupInfo;
+class ClipPopupSort;
+class ClipPopupView;
+class ClipPopupViewWindow;
+class ClipPopupCopy;
+class ClipPopupPaste;
+class ClipMatchSize;
+class ClipMatchRate;
+class ClipMatchAll;
+class ClipPopupProjectRemove;
+class ClipPopupDiskRemove;
+class ClipPasteToFolder;
+class ClipListMenu;
+class ClipListFormat;
+
+#endif
void CWindowEditing::to_clip()
{
- mwindow->to_clip(_("composer window: "));
+ mwindow->to_clip(mwindow->edl, _("composer window: "));
}
else
if(file->tag.title_is("ASSETS"))
{
- if((load_flags & LOAD_ASSETS) &&
- !parent_edl)
+ if(load_flags & LOAD_ASSETS)
assets->load(file, load_flags);
else
result = file->skip_tag();
// Media
// Don't replicate all assets for every clip.
-// The assets for the clips are probably in the mane EDL.
- if(!is_clip)
- copy_assets(start,
- end,
- file,
- all,
- output_path);
-
+// The assets for the clips are probably in the main EDL.
+ if( !is_clip )
+ copy_assets(start, end, file, all, output_path);
// Clips
// Don't want this if using clipboard
if(all)
//printf("EDL::copy 2\n");
// terminate file
- if(is_clip)
+ if( is_clip )
file->tag.set_title("/CLIP_EDL");
- else
- if(is_vwindow)
+ else if( is_vwindow )
file->tag.set_title("/VWINDOW_EDL");
else
file->tag.set_title("/EDL");
//sprintf(str, "%02d:%02d:%02d:%02d", hour, minute, second, hundredths);
}
-int ExportEDLAsset::edit_to_timecodes(Edit *edit, char *sourceinpoint, char *sourceoutpoint, char *destinpoint, char *destoutpoint, char *reel_name)
+int ExportEDLAsset::edit_to_timecodes(Edit *edit,
+ char *sourceinpoint, char *sourceoutpoint,
+ char *destinpoint, char *destoutpoint,
+ char *reel_name)
{
- Asset *asset = edit->asset;
Track *track = edit->track;
double frame_rate = edit->track->edl->session->frame_rate;
double edit_deststart;
double edit_destend;
- if (asset)
- {
- // reelname should be 8 chars long
-
- strncpy(reel_name, asset->reel_name, 9);
- if (strlen(asset->reel_name) > 8)
- {
- printf(_("Warning: chopping the reel name to eight characters!\n"));
- };
- reel_name[8] = 0;
- for (int i = strlen(reel_name); i<8; i++)
- reel_name[i] = ' ';
-
- edit_sourcestart = (double)asset->tcstart / asset->frame_rate
- + track->from_units(edit->startsource);
- edit_sourceend = (double)asset->tcstart / asset->frame_rate
- + track->from_units(edit->startsource + edit->length);
-
- } else
- {
- strcpy(reel_name, " BL ");
- edit_sourcestart = 0;
- edit_sourceend = track->from_units(edit->length);
- }
+ strcpy(reel_name, " BL ");
+ edit_sourcestart = 0;
+ edit_sourceend = track->from_units(edit->length);
edit_deststart = track->from_units(edit->startproject);
edit_destend = track->from_units(edit->startproject + edit->length);
last_dissolve = 1;
} else
{
- edit_to_timecodes(edit, sourceinpoint, sourceoutpoint, destinpoint, destoutpoint, reel_name);
+ edit_to_timecodes(edit, sourceinpoint, sourceoutpoint, destinpoint, destoutpoint, reel_name);
fprintf(fh, "%03d %8s %s %4s %3s", colnum, reel_name, avselect, edittype, cutinfo);
fprintf(fh, " %s %s", sourceinpoint, sourceoutpoint);
fprintf(fh, " %s %s", destinpoint, destoutpoint);
int load_defaults();
int save_defaults();
private:
- int edit_to_timecodes(Edit *edit, char *sourceinpoint, char *sourceoutpoint, char *destinpoint, char *destoutpoint, char *reel_name);
+ int edit_to_timecodes(Edit *edit,
+ char *sourceinpoint, char *sourceoutpoint,
+ char *destinpoint, char *destoutpoint,
+ char *reel_name);
void double_to_CMX3600(double seconds, double frame_rate, char *str);
};
*rp = 0;
}
+void File::setenv_path(char *result, const char *var, const char *path)
+{
+ char *env = getenv(var);
+ if( env ) return;
+ char env_path[BCTEXTLEN];
+ getenv_path(env_path, path);
+ sprintf(result, "%s=%s", var, env_path);
+ putenv(result);
+}
+
char File::cinexe_path[BCTEXTLEN];
char File::cinpkg_path[BCTEXTLEN];
char File::cindat_path[BCTEXTLEN];
snprintf(cinpkg_path, sizeof(cinpkg_path), "CIN_PKG=%s", env_pkg);
putenv(cinpkg_path);
- getenv_path(env_path, CINDAT_DIR);
- snprintf(cindat_path, sizeof(cindat_path), "CIN_DAT=%s", env_path);
- putenv(cindat_path);
-
- getenv_path(env_path, CINLIB_DIR);
- snprintf(cinlib_path, sizeof(cinlib_path), "CIN_LIB=%s", env_path);
- putenv(cinlib_path);
-
- getenv_path(env_path, CONFIG_DIR);
- snprintf(cincfg_path, sizeof(cincfg_path), "CIN_CONFIG=%s", env_path);
- putenv(cincfg_path);
-
- getenv_path(env_path, PLUGIN_DIR);
- snprintf(cinplg_path, sizeof(cinplg_path), "CIN_PLUGIN=%s", env_path);
- putenv(cinplg_path);
-
- getenv_path(env_path, LADSPA_DIR);
- snprintf(cinlad_path, sizeof(cinlad_path), "CIN_LADSPA=%s", env_path);
- putenv(cinlad_path);
-
- getenv_path(env_path, LOCALE_DIR);
- snprintf(cinlcl_path, sizeof(cinlcl_path), "CIN_LOCALE=%s", env_path);
- putenv(cinlcl_path);
-
-#ifndef CIN_BROWSER
-#define CIN_BROWSER "firefox"
-#endif
- getenv_path(env_path, CIN_BROWSER);
- snprintf(cinbwr_path, sizeof(cinlcl_path), "CIN_BROWSER=%s", env_path);
- putenv(cinbwr_path);
+ setenv_path(cindat_path, "CIN_DAT", CINDAT_DIR);
+ setenv_path(cinlib_path, "CIN_LIB", CINLIB_DIR);
+ setenv_path(cincfg_path, "CIN_CONFIG", CONFIG_DIR);
+ setenv_path(cinplg_path, "CIN_PLUGIN", PLUGIN_DIR);
+ setenv_path(cinlad_path, "CIN_LADSPA", LADSPA_DIR);
+ setenv_path(cinlcl_path, "CIN_LOCALE", LOCALE_DIR);
+ setenv_path(cinbwr_path, "CIN_BROWSER", CIN_BROWSER);
}
static void init_cin_path();
static void get_exe_path(char *result, char *bnp=0);
static void getenv_path(char *result, const char *path);
+ static void setenv_path(char *result, const char *var, const char *path);
static char cinexe_path[BCTEXTLEN], cinpkg_path[BCTEXTLEN];
static char cindat_path[BCTEXTLEN], cinlib_path[BCTEXTLEN];
static char cincfg_path[BCTEXTLEN], cinplg_path[BCTEXTLEN];
#ifndef FILE_INC
#define FILE_INC
+// Normally, these are sourced from the compiler command line
+// as: c++ -Dvar=value defines
+#ifndef CIN_CONFIG
+#define CIN_CONFIG "~/.bcast5"
+#endif
+#ifndef LOCALE_DIR
+#define LOCALE_DIR "$CIN_LIB/locale"
+#endif
+#ifndef CINDAT_DIR
+#define CINDAT_DIR "$CIN_PATH"
+#endif
+#ifndef CINLIB_DIR
+#define CINLIB_DIR "$CIN_PATH"
+#endif
+#ifndef PLUGIN_DIR
+#define PLUGIN_DIR "$CIN_LIB/plugins"
+#endif
+#ifndef LADSPA_DIR
+#define LADSPA_DIR "$CIN_LIB/ladspa"
+#endif
+#ifndef CIN_BROWSER
+#define CIN_BROWSER "firefox"
+#endif
+
#include "language.h"
// Return values for open_file
asset->channels = audio_channels;
asset->sample_rate = ff->ff_sample_rate(0);
asset->audio_length = ff->ff_audio_samples(0);
+ strcpy(asset->acodec, ff->ff_audio_format(0));
}
int video_layers = ff->ff_total_video_layers();
if( video_layers > 0 ) {
(asset->video_length = ff->ff_video_frames(0)) < 2 )
asset->video_length = asset->video_length < 0 ? 0 : -1;
if( !asset->frame_rate ) asset->frame_rate = ff->ff_frame_rate(0);
+ strcpy(asset->vcodec, ff->ff_video_format(0));
}
IndexState *index_state = asset->index_state;
index_state->read_markers(file->preferences->index_directory, asset->path);
#include "awindow.h"
#include "awindowgui.h"
-#include "awindowmenu.h"
+#include "folderlistmenu.h"
#include "edl.h"
#include "edlsession.h"
#include "language.h"
#include "mwindow.h"
-
-
-
-AssetListMenu::AssetListMenu(MWindow *mwindow, AWindowGUI *gui)
- : BC_PopupMenu(0,
- 0,
- 0,
- "",
- 0)
-{
- this->mwindow = mwindow;
- this->gui = gui;
-}
-
-AssetListMenu::~AssetListMenu()
-{
-}
-
-void AssetListMenu::create_objects()
-{
- add_item(format = new AssetListFormat(mwindow));
- add_item(new AssetListSort(mwindow));
- update_titles();
-}
-
-void AssetListMenu::update_titles()
-{
- format->update();
-}
-
-
-
-
-
-
-
-
-AssetListFormat::AssetListFormat(MWindow *mwindow)
- : BC_MenuItem("")
-{
- this->mwindow = mwindow;
-}
-
-void AssetListFormat::update()
-{
- set_text(mwindow->edl->session->assetlist_format == ASSETS_TEXT ?
- (char*)_("Display icons") : (char*)_("Display text"));
-}
-
-int AssetListFormat::handle_event()
-{
- AWindowGUI *agui = mwindow->awindow->gui;
- agui->stop_vicon_drawing();
-
- EDLSession *session = mwindow->edl->session;
- switch(session->assetlist_format) {
- case ASSETS_TEXT:
- session->assetlist_format = ASSETS_ICONS;
- break;
- case ASSETS_ICONS:
- session->assetlist_format = ASSETS_TEXT;
- break;
- }
-
- agui->asset_list->update_format(session->assetlist_format, 1);
- if (!mwindow->awindow->gui->allow_iconlisting) {
- mwindow->edl->session->assetlist_format = ASSETS_TEXT;
- }
-
- agui->start_vicon_drawing();
- return 1;
-}
-
-
-
-
-AssetListSort::AssetListSort(MWindow *mwindow)
- : BC_MenuItem(_("Sort items"))
-{
- this->mwindow = mwindow;
-}
-
-int AssetListSort::handle_event()
-{
- mwindow->awindow->gui->sort_assets();
- return 1;
-}
-
-
-
-
FolderListMenu::FolderListMenu(MWindow *mwindow, AWindowGUI *gui)
- : BC_PopupMenu(0,
- 0,
- 0,
- "",
- 0)
+ : BC_PopupMenu(0, 0, 0, "", 0)
{
this->mwindow = mwindow;
this->gui = gui;
}
-
void FolderListMenu::update_titles()
{
format->set_text(mwindow->edl->session->folderlist_format == FOLDERS_TEXT ?
-
-
-
-
FolderListFormat::FolderListFormat(MWindow *mwindow, FolderListMenu *menu)
: BC_MenuItem("")
{
this->mwindow = mwindow;
this->menu = menu;
}
+
int FolderListFormat::handle_event()
{
- switch(mwindow->edl->session->folderlist_format)
- {
- case FOLDERS_TEXT:
- mwindow->edl->session->folderlist_format = FOLDERS_ICONS;
- break;
- case FOLDERS_ICONS:
- mwindow->edl->session->folderlist_format = FOLDERS_TEXT;
- break;
+ switch(mwindow->edl->session->folderlist_format) {
+ case FOLDERS_TEXT:
+ mwindow->edl->session->folderlist_format = FOLDERS_ICONS;
+ break;
+ case FOLDERS_ICONS:
+ mwindow->edl->session->folderlist_format = FOLDERS_TEXT;
+ break;
}
mwindow->awindow->gui->folder_list->update_format(
return 1;
}
-
-
*
*/
-#ifndef AWINDOWMENU_H
-#define AWINDOWMENU_H
+#ifndef FOLDERLISTMENU_H
+#define FOLDERLISTMENU_H
#include "awindowgui.inc"
#include "edl.inc"
#include "guicast.h"
#include "mwindow.inc"
-class AssetListFormat;
-
-class AssetListMenu : public BC_PopupMenu
-{
-public:
- AssetListMenu(MWindow *mwindow, AWindowGUI *gui);
- ~AssetListMenu();
-
- void create_objects();
- void update_titles();
-
- AssetListFormat *format;
-
- MWindow *mwindow;
- AWindowGUI *gui;
-};
-
-
-class AssetListFormat : public BC_MenuItem
-{
-public:
- AssetListFormat(MWindow *mwindow);
-
- void update();
- int handle_event();
- MWindow *mwindow;
-};
-
-
-class AssetListSort : public BC_MenuItem
+class FolderListFormat : public BC_MenuItem
{
public:
- AssetListSort(MWindow *mwindow);
+ FolderListFormat(MWindow *mwindow, FolderListMenu *menu);
- void update();
int handle_event();
MWindow *mwindow;
+ FolderListMenu *menu;
};
-
-
-
-
-class FolderListFormat;
-
-
-
class FolderListMenu : public BC_PopupMenu
{
public:
AWindowGUI *gui;
};
-
-class FolderListFormat : public BC_MenuItem
-{
-public:
- FolderListFormat(MWindow *mwindow, FolderListMenu *menu);
-
- int handle_event();
- MWindow *mwindow;
- FolderListMenu *menu;
-};
-
-
-
#endif
-
/*
* CINELERRA
* Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
*
*/
-#ifndef AWINDOWMENU_INC
-#define AWINDOWMENU_INC
-
-
+#ifndef FOLDERLISTMENU_INC
+#define FOLDERLISTMENU_INC
-
-class AssetListMenu;
+class FolderListFormat;
class FolderListMenu;
-class AssetListFormat;
-
-
#endif
this->mwindow = mwindow;
this->indexable = indexable;
redraw_timer = new Timer;
-
if(indexable)
{
indexable->add_user();
// open the source file
if(open_source()) return 1;
+ source_channels = indexable->get_audio_channels();
+ source_samplerate = indexable->get_sample_rate();
+ source_length = indexable->get_audio_samples();
SET_TRACE
-
/*
* CINELERRA
* Copyright (C) 2006 Pierre Dumuid
+ * Copyright (C) 1997-2012 Adam Williams <broadcast at earthling dot net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
#include "awindow.h"
#include "awindowgui.h"
+#include "bcdialog.h"
#include "labeledit.h"
-#include "edl.h"
-#include "fonts.h"
#include "language.h"
-#include "localsession.h"
-#include "mainsession.h"
#include "mwindow.h"
#include "mwindowgui.h"
#include "vwindow.h"
#include "vwindowgui.h"
-
LabelEdit::LabelEdit(MWindow *mwindow, AWindow *awindow, VWindow *vwindow)
- : Thread()
+ : BC_DialogThread()
{
this->mwindow = mwindow;
this->awindow = awindow;
this->vwindow = vwindow;
- this->label = 0;
+ label = 0;
+ label_edit_window = 0;
}
LabelEdit::~LabelEdit()
{
+ close_window();
}
-void LabelEdit::edit_label(Label *label)
+void LabelEdit::start(Label *label)
{
-// Allow more than one window so we don't have to delete the clip in handle_event
- if(label)
- {
- this->label = label;
- Thread::start();
- }
+ this->label = label;
+ BC_DialogThread::start();
}
-void LabelEdit::run()
+void LabelEdit::handle_close_event(int result)
{
- if(label)
- {
- LabelEditWindow *window = new LabelEditWindow(mwindow, this);
- window->create_objects();
- /*int result = */ window->run_window();
- delete window;
- if (awindow) awindow->gui->async_update_assets();
- }
+ label_edit_window = 0;
}
+void LabelEdit::handle_done_event(int result)
+{
+ awindow->gui->async_update_assets();
+}
+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->create_objects();
+ return label_edit_window;
+}
-
-
-
-LabelEditWindow::LabelEditWindow(MWindow *mwindow, LabelEdit *thread)
- : BC_Window(_(PROGRAM_NAME ": Label 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)
+LabelEditWindow::LabelEditWindow(MWindow *mwindow, LabelEdit *thread, int x, int y)
+ : BC_Window(_(PROGRAM_NAME ": Label Info"), x, y,
+ 400, 350, 400, 430, 0, 0, 1)
{
this->mwindow = mwindow;
this->thread = thread;
{
}
-
void LabelEditWindow::create_objects()
{
this->label = thread->label;
add_subwindow(title = new BC_Title(x1, y, _("Label Text:")));
y += title->get_h() + 5;
- add_subwindow(textbox = new LabelEditComments(this,
- x1,
- y,
- get_w() - x1 * 2,
+ add_subwindow(textbox = new LabelEditComments(this, x1, y, get_w() - x1 * 2,
BC_TextBox::pixels_to_rows(this, MEDIUMFONT, get_h() - 10 - 40 - y)));
-
add_subwindow(new BC_OKButton(this));
add_subwindow(new BC_CancelButton(this));
show_window();
textbox->activate();
}
-
-
-
-
-
LabelEditComments::LabelEditComments(LabelEditWindow *window, int x, int y, int w, int rows)
: BC_TextBox(x, y, w, rows, window->label->textstr, 1, MEDIUMFONT, 1)
{
strcpy(window->label->textstr, get_text());
return 1;
}
+
-
/*
* CINELERRA
* Copyright (C) 2006 Pierre Dumuid
+ * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
#ifndef LABELEDIT_H
#define LABELEDIT_H
+#include "assetedit.inc"
+#include "assets.inc"
#include "awindow.inc"
-#include "edl.inc"
+#include "awindowgui.inc"
#include "guicast.h"
+#include "labeledit.inc"
#include "mwindow.inc"
-#include "thread.h"
#include "vwindow.inc"
-class LabelEdit : public Thread
+class LabelEdit : public BC_DialogThread
{
public:
LabelEdit(MWindow *mwindow, AWindow *awindow, VWindow *vwindow);
~LabelEdit();
- void run();
- void edit_label(Label *label);
+ BC_Window *new_gui();
+ void start(Label *label);
+ void handle_close_event(int result);
+ void handle_done_event(int result);
// If it is being created or edited
MWindow *mwindow;
VWindow *vwindow;
Label *label;
+ LabelEditWindow *label_edit_window;
};
-
-
-
class LabelEditWindow : public BC_Window
{
public:
- LabelEditWindow(MWindow *mwindow, LabelEdit *thread);
+ LabelEditWindow(MWindow *mwindow, LabelEdit *thread, int x, int y);
~LabelEditWindow();
void create_objects();
-
// Use this copy of the pointer in LabelEdit since multiple windows are possible
Label *label;
MWindow *mwindow;
LabelEdit *thread;
};
-
-
class LabelEditTitle : public BC_TextBox
{
public:
LabelEditWindow *window;
};
-
class LabelEditComments : public BC_TextBox
{
public:
LabelEditWindow *window;
};
-
-
-
-
-
#endif
-
/*
* CINELERRA
* Copyright (C) 2006 Pierre Dumuid
+ * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
#ifndef LABELEDIT_INC
#define LABELEDIT_INC
-
-
-
class LabelEdit;
-
-
+class LabelEditWindow;
+class LabelEditTitle;
+class LabelEditComments;
#endif
--- /dev/null
+/*
+ * CINELERRA
+ * Copyright (C) 2006 Pierre Dumuid
+ * Copyright (C) 1997-2012 Adam Williams <broadcast at earthling dot net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#include "awindow.h"
+#include "awindowgui.h"
+#include "bcdialog.h"
+#include "labeledit.h"
+#include "labelpopup.h"
+#include "edl.h"
+#include "fonts.h"
+#include "language.h"
+#include "localsession.h"
+#include "mainsession.h"
+#include "mbuttons.h"
+#include "mwindow.h"
+#include "mwindowgui.h"
+#include "vwindow.h"
+#include "vwindowgui.h"
+
+
+LabelPopup::LabelPopup(MWindow *mwindow, AWindowGUI *gui)
+ : BC_PopupMenu(0, 0, 0, "", 0)
+{
+ this->mwindow = mwindow;
+ this->gui = gui;
+}
+
+LabelPopup::~LabelPopup()
+{
+}
+
+void LabelPopup::create_objects()
+{
+ add_item(editlabel = new LabelPopupEdit(mwindow, gui));
+ add_item(new LabelPopupDelete(mwindow, gui));
+ add_item(new LabelPopupGoTo(mwindow, gui));
+}
+
+int LabelPopup::update()
+{
+ gui->collect_assets();
+ return 0;
+}
+
+
+LabelPopupEdit::LabelPopupEdit(MWindow *mwindow, AWindowGUI *gui)
+ : BC_MenuItem(_("Edit..."))
+{
+ this->mwindow = mwindow;
+ this->gui = gui;
+}
+
+LabelPopupEdit::~LabelPopupEdit()
+{
+}
+
+int LabelPopupEdit::handle_event()
+{
+ AssetPicon *result = (AssetPicon*)gui->asset_list->get_selection(0,0);
+ if( result && result->label )
+ gui->awindow->label_edit->start(result->label);
+ return 1;
+}
+
+LabelPopupDelete::LabelPopupDelete(MWindow *mwindow, AWindowGUI *gui)
+ : BC_MenuItem(_("Delete"))
+{
+ this->mwindow = mwindow;
+ this->gui = gui;
+}
+LabelPopupDelete::~LabelPopupDelete()
+{
+}
+
+int LabelPopupDelete::handle_event()
+{
+ AssetPicon *result = (AssetPicon*)gui->asset_list->get_selection(0,0);
+ if( result && result->label ) {
+ delete result->label;
+ mwindow->gui->lock_window("LabelPopupDelete::handle_event");
+ mwindow->gui->update_timebar(0);
+ mwindow->gui->unlock_window();
+ gui->async_update_assets();
+ }
+ return 1;
+}
+
+
+LabelPopupGoTo::LabelPopupGoTo(MWindow *mwindow, AWindowGUI *gui)
+ : BC_MenuItem(_("Go to"))
+{
+ this->mwindow = mwindow;
+ this->gui = gui;
+}
+LabelPopupGoTo::~LabelPopupGoTo()
+{
+}
+
+int LabelPopupGoTo::handle_event()
+{
+ AssetPicon *result = (AssetPicon*)gui->asset_list->get_selection(0,0);
+ if( result && result->label ) {
+ double position = result->label->position;
+ gui->unlock_window();
+ int locked = mwindow->gui->get_window_lock();
+ if( locked ) mwindow->gui->unlock_window();
+ PlayTransport *transport = mwindow->gui->mbuttons->transport;
+ transport->change_position(position);
+ if( locked ) mwindow->gui->lock_window("LabelPopupGoTo::handle_event");
+ gui->lock_window("LabelPopupGoTo::handle_event 1");
+ }
+ return 1;
+}
+
+
+LabelListMenu::LabelListMenu(MWindow *mwindow, AWindowGUI *gui)
+ : BC_PopupMenu(0, 0, 0, "", 0)
+{
+ this->mwindow = mwindow;
+ this->gui = gui;
+}
+
+LabelListMenu:: ~LabelListMenu()
+{
+}
+
+void LabelListMenu::create_objects()
+{
+ add_item(format = new AWindowListFormat(mwindow));
+ add_item(new AWindowListSort(mwindow));
+}
+
+void LabelListMenu::update()
+{
+ format->update();
+}
+
--- /dev/null
+/*
+ * CINELERRA
+ * Copyright (C) 2006 Pierre Dumuid
+ * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#ifndef LABELPOPUP_H
+#define LABELPOPUP_H
+
+#include "assetedit.inc"
+#include "assets.inc"
+#include "awindowgui.inc"
+#include "clippopup.inc"
+#include "edl.inc"
+#include "guicast.h"
+#include "labelpopup.inc"
+#include "mwindow.inc"
+
+
+class LabelPopup : public BC_PopupMenu
+{
+public:
+ LabelPopup(MWindow *mwindow, AWindowGUI *gui);
+ ~LabelPopup();
+
+ void create_objects();
+// Set mainsession with the current selections
+ int update();
+
+ MWindow *mwindow;
+ AWindowGUI *gui;
+
+ LabelPopupEdit *editlabel;
+};
+
+class LabelPopupEdit : public BC_MenuItem
+{
+public:
+ LabelPopupEdit(MWindow *mwindow, AWindowGUI *gui);
+ ~LabelPopupEdit();
+
+ int handle_event();
+
+ MWindow *mwindow;
+ AWindowGUI *gui;
+};
+
+class LabelPopupDelete : public BC_MenuItem
+{
+public:
+ LabelPopupDelete(MWindow *mwindow, AWindowGUI *gui);
+ ~LabelPopupDelete();
+
+ int handle_event();
+
+ MWindow *mwindow;
+ AWindowGUI *gui;
+};
+
+class LabelPopupGoTo : public BC_MenuItem
+{
+public:
+ LabelPopupGoTo(MWindow *mwindow, AWindowGUI *gui);
+ ~LabelPopupGoTo();
+
+ int handle_event();
+
+ MWindow *mwindow;
+ AWindowGUI *gui;
+};
+
+class LabelListMenu : public BC_PopupMenu
+{
+public:
+ LabelListMenu(MWindow *mwindow, AWindowGUI *gui);
+ ~LabelListMenu();
+
+ void create_objects();
+ void update();
+
+ MWindow *mwindow;
+ AWindowGUI *gui;
+ AWindowListFormat *format;
+};
+
+#endif
--- /dev/null
+/*
+ * CINELERRA
+ * Copyright (C) 2006 Pierre Dumuid
+ * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#ifndef LABELPOPUP_INC
+#define LABELPOPUP_INC
+
+class LabelPopup;
+class LabelPopupEdit;
+class LabelListMenu;
+
+#endif
{
MWindowGUI *gui = mwindow->gui;
gui->unlock_window();
- mwindow->to_clip(_("main window: "));
+ mwindow->to_clip(mwindow->edl, _("main window: "));
gui->lock_window("MainEditing::to_clip");
}
if(update_filename)
set_filename(new_edl->local_session->clip_title);
}
+ else
+ if( load_mode == LOADMODE_RESOURCESONLY ) {
+ strcpy(new_edl->local_session->clip_title,
+ filenames->get(i));
+ struct stat st;
+ time_t t = !stat(filenames->get(i),&st) ?
+ st.st_mtime : time(&t);
+ ctime_r(&t, new_edl->local_session->clip_notes);
+ }
}
new_edls.append(new_edl);
if(debug) printf("MWindow::load_filenames %d\n", __LINE__);
- if(!result) gui->statusbar->default_message();
-
-
-
-
-
+ if(!result) {
+ gui->reset_default_message();
+ gui->default_message();
+ }
if(debug) printf("MWindow::load_filenames %d\n", __LINE__);
}
if(debug) printf("MWindow::load_filenames %d\n", __LINE__);
- if(new_assets.size())
+ for(int i = 0; i < new_assets.size(); i++)
{
- for(int i = 0; i < new_assets.size(); i++)
- {
- Asset *new_asset = new_assets[i];
+ Asset *new_asset = new_assets[i];
- File *new_file = 0;
- int got_it = 0;
- for(int j = 0; j < new_files.size(); j++)
+ File *new_file = 0;
+ int got_it = 0;
+ for(int j = 0; j < new_files.size(); j++)
+ {
+ new_file = new_files[j];
+ if(!strcmp(new_file->asset->path,
+ new_asset->path))
{
- new_file = new_files[j];
- if(!strcmp(new_file->asset->path,
- new_asset->path))
- {
- got_it = 1;
- break;
- }
+ got_it = 1;
+ break;
}
-
- mainindexes->add_next_asset(got_it ? new_file : 0, new_asset);
- got_indexes = 1;
- edl->assets->update(new_asset);
-
}
-
+ mainindexes->add_next_asset(got_it ? new_file : 0, new_asset);
+ got_indexes = 1;
+ edl->assets->update(new_asset);
}
if(debug) printf("MWindow::load_filenames %d\n", __LINE__);
index_state->index_status = INDEX_NOTTESTED;
if( indexable->is_asset ) {
Asset *asset = (Asset *)indexable;
- if( asset->format != FILE_PCM )
+ if( asset->format != FILE_PCM ) {
+ asset->format = FILE_UNKNOWN;
asset->reset_audio();
+ }
asset->reset_video();
+// File file; // re-probe the asset
+// file.open_file(preferences, asset, 1, 0);
}
mainindexes->add_next_asset(0, indexable);
}
// Synchronize EDL settings with all playback engines depending on current
// operation. Doesn't redraw anything.
void sync_parameters(int change_type = CHANGE_PARAMS);
+ void save_clip(EDL *new_edl, const char *txt);
void to_clip(EDL *edl, const char *txt);
- void to_clip(const char *txt);
int toggle_label(int is_mwindow);
void undo_entry(BC_WindowBase *calling_window_gui);
void redo_entry(BC_WindowBase *calling_window_gui);
#include "automation.h"
#include "maskautos.h"
-
#include <string.h>
-
-
-
-
-
void MWindow::add_audio_track_entry(int above, Track *dst)
{
undo->update_undo_before();
undo->update_undo_after(_("add track"), LOAD_ALL);
restart_brender();
- gui->update(1,
- 1,
- 0,
- 0,
- 1,
- 0,
- 0);
+ gui->update(1, 1, 0, 0, 1, 0, 0);
gui->activate_timeline();
// gui->get_scrollbars(0);
// gui->cursor->draw(1);
// gui->canvas->flash();
// gui->canvas->activate();
- cwindow->playback_engine->que->send_command(CURRENT_FRAME,
- CHANGE_EDL,
- edl,
- 1);
+ cwindow->playback_engine->que->
+ send_command(CURRENT_FRAME, CHANGE_EDL, edl, 1);
}
void MWindow::add_video_track_entry(Track *dst)
return 0;
}
-
-
-
void MWindow::asset_to_all()
{
- if(!session->drag_assets->size()) return;
+ if( !session->drag_assets->size() ) return;
Indexable *indexable = session->drag_assets->get(0);
-// if(indexable->have_video())
+// if( indexable->have_video() )
{
int w, h;
int new_samplerate = session->drag_assets->get(0)->get_sample_rate();
- if(indexable->have_video())
- {
+ if( indexable->have_video() ) {
edl->session->output_w = w;
edl->session->output_h = h;
edl->session->frame_rate = new_framerate;
- create_aspect_ratio(edl->session->aspect_w,
+ create_aspect_ratio(
+ edl->session->aspect_w,
edl->session->aspect_h,
- w,
- h);
+ w, h);
- for(Track *current = edl->tracks->first;
- current;
- current = NEXT)
- {
- if(current->data_type == TRACK_VIDEO /* &&
- current->record */ )
- {
+ for( Track *current = edl->tracks->first; current; current = NEXT ) {
+ if( current->data_type == TRACK_VIDEO /* &&
+ current->record */ ) {
current->track_w = w;
current->track_h = h;
}
}
- if(((edl->session->output_w % 4) ||
+ if( ((edl->session->output_w % 4) ||
(edl->session->output_h % 4)) &&
- edl->session->playback_config->vconfig->driver == PLAYBACK_X11_GL)
- {
+ edl->session->playback_config->vconfig->driver == PLAYBACK_X11_GL ) {
MainError::show_error(
_("This project's dimensions are not multiples of 4 so\n"
"it can't be rendered by OpenGL."));
}
-
// Get aspect ratio
- if(defaults->get("AUTOASPECT", 0))
- {
- create_aspect_ratio(edl->session->aspect_w,
+ if( defaults->get("AUTOASPECT", 0) ) {
+ create_aspect_ratio(
+ edl->session->aspect_w,
edl->session->aspect_h,
- w,
- h);
+ w, h);
}
}
- if(indexable->have_audio())
- {
+ if( indexable->have_audio() ) {
edl->session->sample_rate = new_samplerate;
edl->resample(old_framerate, new_framerate, TRACK_VIDEO);
edl->resample(old_samplerate, new_samplerate, TRACK_AUDIO);
}
-
save_backup();
undo->update_undo_after(_("asset to all"), LOAD_ALL);
restart_brender();
- gui->update(1,
- 2,
- 1,
- 1,
- 1,
- 1,
- 0);
+ gui->update(1, 2, 1, 1, 1, 1, 0);
sync_parameters(CHANGE_ALL);
}
}
-
-
-
-
-
void MWindow::asset_to_size()
{
- if(!session->drag_assets->size()) return;
+ if( !session->drag_assets->size() ) return;
Indexable *indexable = session->drag_assets->get(0);
- if(indexable->have_video())
- {
+ if( indexable->have_video() ) {
int w, h;
undo->update_undo_before();
// Get w and h
w = indexable->get_w();
h = indexable->get_h();
-
-
edl->session->output_w = w;
edl->session->output_h = h;
- if(((edl->session->output_w % 4) ||
+ if( ((edl->session->output_w % 4) ||
(edl->session->output_h % 4)) &&
- edl->session->playback_config->vconfig->driver == PLAYBACK_X11_GL)
- {
+ edl->session->playback_config->vconfig->driver == PLAYBACK_X11_GL ) {
MainError::show_error(
_("This project's dimensions are not multiples of 4 so\n"
"it can't be rendered by OpenGL."));
}
-
// Get aspect ratio
- if(defaults->get("AUTOASPECT", 0))
- {
+ if( defaults->get("AUTOASPECT", 0) ) {
create_aspect_ratio(edl->session->aspect_w,
edl->session->aspect_h,
w,
void MWindow::asset_to_rate()
{
- if(session->drag_assets->size() &&
- session->drag_assets->get(0)->have_video())
- {
+ if( session->drag_assets->size() &&
+ session->drag_assets->get(0)->have_video() ) {
double new_framerate = session->drag_assets->get(0)->get_frame_rate();
double old_framerate = edl->session->frame_rate;
undo->update_undo_before();
undo->update_undo_after(_("asset to rate"), LOAD_ALL);
restart_brender();
- gui->update(1,
- 2,
- 1,
- 1,
- 1,
- 1,
- 0);
+ gui->update(1, 2, 1, 1, 1, 1, 0);
sync_parameters(CHANGE_ALL);
}
}
-
void MWindow::clear_entry()
{
undo->update_undo_before();
update_plugin_guis();
gui->update(1, 2, 1, 1, 1, 1, 0);
cwindow->update(1, 0, 0, 0, 1);
- cwindow->playback_engine->que->send_command(CURRENT_FRAME,
- CHANGE_EDL,
- edl,
- 1);
+ cwindow->playback_engine->que->
+ send_command(CURRENT_FRAME, CHANGE_EDL, edl, 1);
}
void MWindow::clear(int clear_handle)
{
double start = edl->local_session->get_selectionstart();
double end = edl->local_session->get_selectionend();
- if(clear_handle || !EQUIV(start, end))
- {
+ if( clear_handle || !EQUIV(start, end) ) {
edl->clear(start,
end,
edl->session->labels_follow_edits,
restart_brender();
gui->update(1, 1, 0, 0, 1, 0, 0);
- cwindow->playback_engine->que->send_command(CURRENT_FRAME,
- CHANGE_EDL,
- edl,
- 1);
+ cwindow->playback_engine->que->
+ send_command(CURRENT_FRAME, CHANGE_EDL, edl, 1);
}
int MWindow::copy(double start, double end)
{
- if(start == end) return 1;
+ if( start == end ) return 1;
-//printf("MWindow::copy 1\n");
FileXML file;
-//printf("MWindow::copy 1\n");
- edl->copy(start,
- end,
- 0,
- 0,
- 0,
- &file,
- "",
- 1);
-//printf("MWindow::copy 1\n");
-
-// File is now terminated and rewound
-
-//printf("MWindow::copy 1\n");
+ edl->copy(start, end, 0, 0, 0, &file, "", 1);
const char *file_string = file.string();
long file_length = strlen(file_string);
gui->get_clipboard()->to_clipboard(file_string, file_length,
SECONDARY_SELECTION);
gui->get_clipboard()->to_clipboard(file_string, file_length,
BC_PRIMARY_SELECTION);
-//printf("MWindow::copy\n%s\n", file.string);
-//printf("MWindow::copy 2\n");
save_backup();
return 0;
}
int MWindow::copy_automation()
{
FileXML file;
- edl->tracks->copy_automation(edl->local_session->get_selectionstart(),
- edl->local_session->get_selectionend(),
- &file,
- 0,
- 1);
+ double start = edl->local_session->get_selectionstart();
+ double end = edl->local_session->get_selectionend();
+ edl->tracks->copy_automation(start, end, &file, 0, 1);
const char *file_string = file.string();
long file_length = strlen(file_string);
gui->get_clipboard()->to_clipboard(file_string, file_length,
int MWindow::copy_default_keyframe()
{
FileXML file;
- edl->tracks->copy_automation(edl->local_session->get_selectionstart(),
- edl->local_session->get_selectionend(),
- &file,
- 1,
- 0);
+ double start = edl->local_session->get_selectionstart();
+ double end = edl->local_session->get_selectionend();
+ edl->tracks->copy_automation(start, end, &file, 1, 0);
const char *file_string = file.string();
long file_length = strlen(file_string);
gui->get_clipboard()->to_clipboard(file_string, file_length,
undo->update_undo_before();
// Clamp EDL crop region
- if(edl->session->crop_x1 > edl->session->crop_x2)
- {
+ if( edl->session->crop_x1 > edl->session->crop_x2 ) {
edl->session->crop_x1 ^= edl->session->crop_x2;
edl->session->crop_x2 ^= edl->session->crop_x1;
edl->session->crop_x1 ^= edl->session->crop_x2;
}
- if(edl->session->crop_y1 > edl->session->crop_y2)
- {
+ if( edl->session->crop_y1 > edl->session->crop_y2 ) {
edl->session->crop_y1 ^= edl->session->crop_y2;
edl->session->crop_y2 ^= edl->session->crop_y1;
edl->session->crop_y1 ^= edl->session->crop_y2;
edl->session->crop_y2 = edl->session->output_h;
// Recalculate aspect ratio
- if(defaults->get("AUTOASPECT", 0))
- {
+ if( defaults->get("AUTOASPECT", 0) ) {
create_aspect_ratio(edl->session->aspect_w,
edl->session->aspect_h,
edl->session->output_w,
undo->update_undo_after(_("crop"), LOAD_ALL);
restart_brender();
- cwindow->playback_engine->que->send_command(CURRENT_FRAME,
- CHANGE_ALL,
- edl,
- 1);
+ cwindow->playback_engine->que->
+ send_command(CURRENT_FRAME, CHANGE_ALL, edl, 1);
save_backup();
}
double end = edl->local_session->get_selectionend();
copy(start, end);
- edl->clear(start,
- end,
+ edl->clear(start, end,
edl->session->labels_follow_edits,
edl->session->plugins_follow_edits,
edl->session->autos_follow_edits);
update_plugin_guis();
gui->update(1, 2, 1, 1, 1, 1, 0);
cwindow->update(1, 0, 0, 0, 1);
- cwindow->playback_engine->que->send_command(CURRENT_FRAME,
- CHANGE_EDL,
- edl,
- 1);
+ cwindow->playback_engine->que->
+ send_command(CURRENT_FRAME, CHANGE_EDL, edl, 1);
}
int MWindow::cut_automation()
void MWindow::delete_track()
{
- if (edl->tracks->last)
+ if( edl->tracks->last )
delete_track(edl->tracks->last);
}
// Insert data from clipboard
-void MWindow::insert(double position,
- FileXML *file,
- int edit_labels,
- int edit_plugins,
- int edit_autos,
+void MWindow::insert(double position, FileXML *file,
+ int edit_labels, int edit_plugins, int edit_autos,
EDL *parent_edl)
{
// For clipboard pasting make the new edl use a separate session
- if(parent_edl) load_flags &= ~LOAD_SESSION;
- if(!edl->session->autos_follow_edits) load_flags &= ~LOAD_AUTOMATION;
- if(!edl->session->labels_follow_edits) load_flags &= ~LOAD_TIMEBAR;
+ if( parent_edl ) load_flags &= ~LOAD_SESSION;
+ if( !edl->session->autos_follow_edits ) load_flags &= ~LOAD_AUTOMATION;
+ if( !edl->session->labels_follow_edits ) load_flags &= ~LOAD_TIMEBAR;
edl->load_xml(file, load_flags);
- paste_edls(&new_edls,
- LOADMODE_PASTE,
- 0,
- position,
- edit_labels,
- edit_plugins,
- edit_autos,
- 0); // overwrite
-// if(vwindow->edl)
+ paste_edls(&new_edls, LOADMODE_PASTE, 0, position,
+ edit_labels, edit_plugins, edit_autos, 0); // overwrite
+// if( vwindow->edl )
// printf("MWindow::insert 5 %f %f\n",
// vwindow->edl->local_session->in_point,
// vwindow->edl->local_session->out_point);
double length)
{
Track *dest_track = session->track_highlighted;
- if(!dest_track) return;
+ if( !dest_track ) return;
undo->update_undo_before();
- for(int i = 0; i < session->drag_pluginservers->total; i++)
- {
+ for( int i = 0; i < session->drag_pluginservers->total; i++ ) {
PluginServer *plugin = session->drag_pluginservers->values[i];
-
- insert_effect(plugin->title,
- 0,
- dest_track,
+ insert_effect(plugin->title, 0, dest_track,
i == 0 ? session->pluginset_highlighted : 0,
- start,
- length,
- PLUGIN_STANDALONE);
+ start, length, PLUGIN_STANDALONE);
}
save_backup();
void MWindow::insert_effects_cwindow(Track *dest_track)
{
- if(!dest_track) return;
+ if( !dest_track ) return;
undo->update_undo_before();
double start = 0;
double length = dest_track->get_length();
- if(edl->local_session->get_selectionend() >
- edl->local_session->get_selectionstart())
- {
+ if( edl->local_session->get_selectionend() >
+ edl->local_session->get_selectionstart() ) {
start = edl->local_session->get_selectionstart();
length = edl->local_session->get_selectionend() -
edl->local_session->get_selectionstart();
}
- for(int i = 0; i < session->drag_pluginservers->total; i++)
- {
+ for( int i = 0; i < session->drag_pluginservers->total; i++ ) {
PluginServer *plugin = session->drag_pluginservers->values[i];
-
-
- insert_effect(plugin->title,
- 0,
- dest_track,
- 0,
- start,
- length,
- PLUGIN_STANDALONE);
+ insert_effect(plugin->title, 0, dest_track, 0,
+ start, length, PLUGIN_STANDALONE);
}
save_backup();
undo->update_undo_after(_("insert effect"), LOAD_EDITS | LOAD_PATCHES);
restart_brender();
sync_parameters(CHANGE_EDL);
- gui->update(1,
- 1,
- 0,
- 0,
- 1,
- 0,
- 0);
+ gui->update(1, 1, 0, 0, 1, 0, 0);
}
void MWindow::insert_effect(char *title,
SharedLocation shared_location_local;
shared_location_local.copy_from(shared_location);
int first_track = 1;
- for( ; current; current = NEXT)
- {
- if(current->data_type == data_type &&
- current->record)
- {
- insert_effect(title,
- &shared_location_local,
- current,
- 0,
- 0,
- 0,
- plugin_type);
-
- if(first_track)
- {
- if(plugin_type == PLUGIN_STANDALONE && single_standalone)
- {
+ for( ; current; current = NEXT) {
+ if( current->data_type == data_type &&
+ current->record ) {
+ insert_effect(title, &shared_location_local,
+ current, 0, 0, 0, plugin_type);
+
+ if( first_track ) {
+ if( plugin_type == PLUGIN_STANDALONE && single_standalone ) {
plugin_type = PLUGIN_SHAREDPLUGIN;
shared_location_local.module = edl->tracks->number_of(current);
shared_location_local.plugin = current->plugin_set.total - 1;
{
KeyFrame *default_keyframe = 0;
PluginServer *server = 0;
-
-
-
-
-
-
// Get default keyframe
- if(plugin_type == PLUGIN_STANDALONE)
- {
+ if( plugin_type == PLUGIN_STANDALONE ) {
default_keyframe = new KeyFrame;
server = new PluginServer(*scan_plugindb(title, track->data_type));
server->open_plugin(0, preferences, edl, 0);
server->save_data(default_keyframe);
}
-
-
-
// Insert plugin object
- track->insert_effect(title,
- shared_location,
- default_keyframe,
- plugin_set,
- start,
- length,
- plugin_type);
-
+ track->insert_effect(title, shared_location,
+ default_keyframe, plugin_set,
+ start, length, plugin_type);
track->optimize();
-
- if(plugin_type == PLUGIN_STANDALONE)
- {
+ if( plugin_type == PLUGIN_STANDALONE ) {
server->close_plugin();
delete server;
delete default_keyframe;
edl->session->autos_follow_edits);
finish_modify_handles();
-
-
//printf("MWindow::modify_handles 1\n");
return 0;
}
{
int edit_mode = edl->session->edit_handle_mode[session->drag_button];
- if((session->drag_handle == 1 && edit_mode != MOVE_NO_EDITS) ||
- (session->drag_handle == 0 && edit_mode == MOVE_ONE_EDIT))
- {
+ if( (session->drag_handle == 1 && edit_mode != MOVE_NO_EDITS) ||
+ (session->drag_handle == 0 && edit_mode == MOVE_ONE_EDIT) ) {
edl->local_session->set_selectionstart(session->drag_position);
edl->local_session->set_selectionend(session->drag_position);
}
else
- if(edit_mode != MOVE_NO_EDITS)
- {
+ if( edit_mode != MOVE_NO_EDITS ) {
edl->local_session->set_selectionstart(session->drag_start);
edl->local_session->set_selectionend(session->drag_start);
}
- if(edl->local_session->get_selectionstart(1) < 0)
- {
+ if( edl->local_session->get_selectionstart(1) < 0 ) {
edl->local_session->set_selectionstart(0);
edl->local_session->set_selectionend(0);
}
undo->update_undo_after(_("move edit"), LOAD_ALL);
restart_brender();
- cwindow->playback_engine->que->send_command(CURRENT_FRAME,
- CHANGE_EDL,
- edl,
- 1);
+ cwindow->playback_engine->que->
+ send_command(CURRENT_FRAME, CHANGE_EDL, edl, 1);
update_plugin_guis();
- gui->update(1,
- 1, // 1 for incremental drawing. 2 for full refresh
- 1,
- 0,
- 0,
- 0,
- 0);
+ gui->update(1, 1, // 1 for incremental drawing. 2 for full refresh
+ 1, 0, 0, 0, 0);
}
void MWindow::move_effect(Plugin *plugin, Track *track, int64_t position)
undo->update_undo_after(_("paste effect"), LOAD_ALL);
restart_brender();
- cwindow->playback_engine->que->send_command(CURRENT_FRAME,
- CHANGE_EDL, edl, 1);
-
+ cwindow->playback_engine->que->
+ send_command(CURRENT_FRAME, CHANGE_EDL, edl, 1);
update_plugin_guis();
gui->update(1, 1, // 1 for incremental drawing. 2 for full refresh
0, 0, 0, 0, 0);
undo->update_undo_after(_("move effect"), LOAD_ALL);
restart_brender();
- cwindow->playback_engine->que->send_command(CURRENT_FRAME, CHANGE_EDL, edl, 1);
+ cwindow->playback_engine->que->
+ send_command(CURRENT_FRAME, CHANGE_EDL, edl, 1);
update_plugin_guis();
gui->update(1, 1, // 1 for incremental drawing. 2 for full refresh
0, 0, 0, 0, 0);
save_backup();
undo->update_undo_after(_("move effect up"), LOAD_ALL);
restart_brender();
- gui->update(1,
- 1, // 1 for incremental drawing. 2 for full refresh
- 0,
- 0,
- 0,
- 0,
- 0);
+ gui->update(1, 1, // 1 for incremental drawing. 2 for full refresh
+ 0, 0, 0, 0, 0);
sync_parameters(CHANGE_EDL);
}
save_backup();
undo->update_undo_after(_("move effect down"), LOAD_ALL);
restart_brender();
- gui->update(1,
- 1, // 1 for incremental drawing. 2 for full refresh
- 0,
- 0,
- 0,
- 0,
- 0);
+ gui->update(1, 1, // 1 for incremental drawing. 2 for full refresh
+ 0, 0, 0, 0, 0);
sync_parameters(CHANGE_EDL);
}
{
double start = edl->local_session->get_selectionstart();
double end = edl->local_session->get_selectionend();
- if(start != end)
- {
+ if( start != end ) {
undo->update_undo_before();
- edl->clear(start,
- end,
- 0,
+ edl->clear(start, end, 0,
edl->session->plugins_follow_edits,
edl->session->autos_follow_edits);
edl->local_session->set_selectionend(end);
edl->local_session->set_selectionstart(start);
- edl->paste_silence(start,
- end,
- 0,
+ edl->paste_silence(start, end, 0,
edl->session->plugins_follow_edits,
edl->session->autos_follow_edits);
save_backup();
restart_brender();
update_plugin_guis();
gui->update(1, 2, 1, 1, 1, 1, 0);
- cwindow->playback_engine->que->send_command(CURRENT_FRAME,
- CHANGE_EDL,
- edl,
- 1);
+ cwindow->playback_engine->que->
+ send_command(CURRENT_FRAME, CHANGE_EDL, edl, 1);
}
}
-
void MWindow::overwrite(EDL *source)
{
FileXML file;
double dst_len = edl->local_session->get_selectionend() - dst_start;
undo->update_undo_before();
- if (!EQUIV(dst_len, 0) && (dst_len < overwrite_len))
- {
+ if( !EQUIV(dst_len, 0) && (dst_len < overwrite_len) ) {
// in/out points or selection present and shorter than overwrite range
// shorten the copy range
overwrite_len = dst_len;
}
- source->copy(src_start,
- src_start + overwrite_len,
- 1,
- 0,
- 0,
- &file,
- "",
- 1);
+ source->copy(src_start, src_start + overwrite_len,
+ 1, 0, 0, &file, "", 1);
// HACK around paste_edl get_start/endselection on its own
// so we need to clear only when not using both io points
// FIXME: need to write simple overwrite_edl to be used for overwrite function
- if (edl->local_session->get_inpoint() < 0 ||
- edl->local_session->get_outpoint() < 0)
- edl->clear(dst_start,
- dst_start + overwrite_len,
- 0,
- 0,
- 0);
+ if( edl->local_session->get_inpoint() < 0 ||
+ edl->local_session->get_outpoint() < 0 )
+ edl->clear(dst_start, dst_start + overwrite_len, 0, 0, 0);
- paste(dst_start,
- dst_start + overwrite_len,
- &file,
- 0,
- 0,
- 0);
+ paste(dst_start, dst_start + overwrite_len,
+ &file, 0, 0, 0);
edl->local_session->set_selectionstart(dst_start + overwrite_len);
edl->local_session->set_selectionend(dst_start + overwrite_len);
clear(0);
// Want to insert with assets shared with the master EDL.
- insert(start,
- file,
- edit_labels,
- edit_plugins,
- edit_autos,
- edl);
+ insert(start, file,
+ edit_labels, edit_plugins, edit_autos,
+ edl);
return 0;
}
//double end = edl->local_session->get_selectionend();
int64_t len = gui->get_clipboard()->clipboard_len(SECONDARY_SELECTION);
- if(len)
- {
+ if( len ) {
char *string = new char[len + 1];
-
undo->update_undo_before();
-
-
- gui->get_clipboard()->from_clipboard(string,
- len,
- BC_PRIMARY_SELECTION);
+ gui->get_clipboard()->from_clipboard(string, len, BC_PRIMARY_SELECTION);
FileXML file;
file.read_from_string(string);
-
-
-
-
clear(0);
- insert(start,
- &file,
+ insert(start, &file,
edl->session->labels_follow_edits,
edl->session->plugins_follow_edits,
edl->session->autos_follow_edits,
0);
edl->optimize();
-
-
delete [] string;
-
-
save_backup();
-
undo->update_undo_after(_("paste"), LOAD_EDITS | LOAD_TIMEBAR);
restart_brender();
update_plugin_guis();
int MWindow::paste_assets(double position, Track *dest_track, int overwrite)
{
int result = 0;
-
undo->update_undo_before();
-
-
- if(session->drag_assets->total)
- {
+ if( session->drag_assets->total ) {
load_assets(session->drag_assets,
- position,
- LOADMODE_PASTE,
- dest_track,
- 0,
+ position, LOADMODE_PASTE, dest_track, 0,
edl->session->labels_follow_edits,
edl->session->plugins_follow_edits,
edl->session->autos_follow_edits,
result = 1;
}
-
- if(session->drag_clips->total)
- {
+ if( session->drag_clips->total ) {
paste_edls(session->drag_clips,
- LOADMODE_PASTE,
- dest_track,
- position,
+ LOADMODE_PASTE, dest_track, position,
edl->session->labels_follow_edits,
edl->session->plugins_follow_edits,
edl->session->autos_follow_edits,
result = 1;
}
-
save_backup();
undo->update_undo_after(_("paste assets"), LOAD_EDITS);
restart_brender();
- gui->update(1,
- 2,
- 1,
- 0,
- 0,
- 1,
- 0);
+ gui->update(1, 2, 1, 0, 0, 1, 0);
sync_parameters(CHANGE_EDL);
return result;
}
int overwrite)
{
const int debug = 0;
-if(debug) printf("MWindow::load_assets %d\n", __LINE__);
- if(position < 0) position = edl->local_session->get_selectionstart();
+if( debug ) printf("MWindow::load_assets %d\n", __LINE__);
+ if( position < 0 ) position = edl->local_session->get_selectionstart();
ArrayList<EDL*> new_edls;
- for(int i = 0; i < new_assets->total; i++)
- {
+ for( int i = 0; i < new_assets->total; i++ ) {
Indexable *indexable = new_assets->get(i);
- if(indexable->is_asset)
- {
+ if( indexable->is_asset ) {
remove_asset_from_caches((Asset*)indexable);
}
EDL *new_edl = new EDL;
new_edls.append(new_edl);
- if(indexable->is_asset)
- {
-if(debug) printf("MWindow::load_assets %d\n", __LINE__);
-if(debug) ((Asset*)indexable)->dump();
+ if( indexable->is_asset ) {
+if( debug ) printf("MWindow::load_assets %d\n", __LINE__);
+if( debug ) ((Asset*)indexable)->dump();
asset_to_edl(new_edl, (Asset*)indexable);
}
else
edl_to_nested(new_edl, (EDL*)indexable);
-if(debug) printf("MWindow::load_assets %d\n", __LINE__);
+if( debug ) printf("MWindow::load_assets %d\n", __LINE__);
- if(labels)
- {
- for(RecordLabel *label = labels->first; label; label = label->next)
- {
+ if( labels ) {
+ for( RecordLabel *label = labels->first; label; label = label->next ) {
new_edl->labels->toggle_label(label->position, label->position);
}
}
}
-if(debug) printf("MWindow::load_assets %d\n", __LINE__);
-
- paste_edls(&new_edls,
- load_mode,
- first_track,
- position,
- edit_labels,
- edit_plugins,
- edit_autos,
- overwrite);
-if(debug) printf("MWindow::load_assets %d\n", __LINE__);
+if( debug ) printf("MWindow::load_assets %d\n", __LINE__);
+ paste_edls(&new_edls, load_mode, first_track, position,
+ edit_labels, edit_plugins, edit_autos, overwrite);
+if( debug ) printf("MWindow::load_assets %d\n", __LINE__);
save_backup();
- for(int i = 0; i < new_edls.size(); i++)
+ for( int i = 0; i < new_edls.size(); i++ )
new_edls.get(i)->Garbage::remove_user();
-if(debug) printf("MWindow::load_assets %d\n", __LINE__);
+if( debug ) printf("MWindow::load_assets %d\n", __LINE__);
}
int MWindow::paste_automation()
{
int64_t len = gui->get_clipboard()->clipboard_len(SECONDARY_SELECTION);
- if(len)
- {
+ if( len ) {
undo->update_undo_before();
char *string = new char[len + 1];
gui->get_clipboard()->from_clipboard(string,
FileXML file;
file.read_from_string(string);
- edl->tracks->clear_automation(edl->local_session->get_selectionstart(),
- edl->local_session->get_selectionend());
- edl->tracks->paste_automation(edl->local_session->get_selectionstart(),
- &file,
- 0,
- 1,
+ double start = edl->local_session->get_selectionstart();
+ double end = edl->local_session->get_selectionend();
+ edl->tracks->clear_automation(start, end);
+ edl->tracks->paste_automation(start, &file, 0, 1,
edl->session->typeless_keyframes);
save_backup();
undo->update_undo_after(_("paste keyframes"), LOAD_AUTOMATION);
delete [] string;
-
restart_brender();
update_plugin_guis();
gui->draw_overlays(1);
{
int64_t len = gui->get_clipboard()->clipboard_len(SECONDARY_SELECTION);
- if(len)
- {
+ if( len ) {
undo->update_undo_before();
char *string = new char[len + 1];
gui->get_clipboard()->from_clipboard(string,
BC_PRIMARY_SELECTION);
FileXML file;
file.read_from_string(string);
- edl->tracks->paste_automation(edl->local_session->get_selectionstart(),
- &file,
- 1,
- 0,
+ double start = edl->local_session->get_selectionstart();
+ edl->tracks->paste_automation(start, &file, 1, 0,
edl->session->typeless_keyframes);
// edl->tracks->paste_default_keyframe(&file);
undo->update_undo_after(_("paste default keyframe"), LOAD_AUTOMATION);
-
restart_brender();
update_plugin_guis();
gui->draw_overlays(1);
// Insert edls with project deletion and index file generation.
-int MWindow::paste_edls(ArrayList<EDL*> *new_edls,
- int load_mode,
- Track *first_track,
- double current_position,
- int edit_labels,
- int edit_plugins,
- int edit_autos,
+int MWindow::paste_edls(ArrayList<EDL*> *new_edls, int load_mode,
+ Track *first_track, double current_position,
+ int edit_labels, int edit_plugins, int edit_autos,
int overwrite)
{
int need_new_tracks = 0;
//PRINT_TRACE
- if(!new_edls->total) return 0;
+ if( !new_edls->total ) return 0;
//PRINT_TRACE
// double original_length = edl->tracks->total_playable_length();
//PRINT_TRACE
// Delete current project
- if(load_mode == LOADMODE_REPLACE ||
- load_mode == LOADMODE_REPLACE_CONCATENATE)
- {
+ if( load_mode == LOADMODE_REPLACE ||
+ load_mode == LOADMODE_REPLACE_CONCATENATE ) {
reset_caches();
-
edl->save_defaults(defaults);
-
hide_plugins();
-
edl->Garbage::remove_user();
-
edl = new EDL;
-
edl->create_objects();
-
edl->copy_session(new_edls->values[0]);
-
gui->mainmenu->update_toggles(0);
-
-
gui->unlock_window();
-
gwindow->gui->update_toggles(1);
-
gui->lock_window("MWindow::paste_edls");
-
// Insert labels for certain modes constitutively
edit_labels = 1;
edit_plugins = 1;
//PRINT_TRACE
// Create new tracks in master EDL
- if(load_mode == LOADMODE_REPLACE ||
- load_mode == LOADMODE_REPLACE_CONCATENATE ||
- load_mode == LOADMODE_NEW_TRACKS)
- {
+ if( load_mode == LOADMODE_REPLACE ||
+ load_mode == LOADMODE_REPLACE_CONCATENATE ||
+ load_mode == LOADMODE_NEW_TRACKS ) {
need_new_tracks = 1;
- for(int i = 0; i < new_edls->total; i++)
- {
+ for( int i = 0; i < new_edls->total; i++ ) {
EDL *new_edl = new_edls->values[i];
- for(Track *current = new_edl->tracks->first;
+ for( Track *current = new_edl->tracks->first;
current;
- current = NEXT)
- {
- if(current->data_type == TRACK_VIDEO)
- {
+ current = NEXT ) {
+ if( current->data_type == TRACK_VIDEO ) {
edl->tracks->add_video_track(0, 0);
- if(current->draw) edl->tracks->last->draw = 1;
+ if( current->draw ) edl->tracks->last->draw = 1;
destination_tracks.append(edl->tracks->last);
}
else
- if(current->data_type == TRACK_AUDIO)
- {
+ if( current->data_type == TRACK_AUDIO ) {
edl->tracks->add_audio_track(0, 0);
destination_tracks.append(edl->tracks->last);
}
else
- if(current->data_type == TRACK_SUBTITLE)
- {
+ if( current->data_type == TRACK_SUBTITLE ) {
edl->tracks->add_subttl_track(0, 0);
destination_tracks.append(edl->tracks->last);
}
}
// Base track count on first EDL only for concatenation
- if(load_mode == LOADMODE_REPLACE_CONCATENATE) break;
+ if( load_mode == LOADMODE_REPLACE_CONCATENATE ) break;
}
}
else
// Recycle existing tracks of master EDL
- if(load_mode == LOADMODE_CONCATENATE ||
- load_mode == LOADMODE_PASTE ||
- load_mode == LOADMODE_NESTED)
- {
+ if( load_mode == LOADMODE_CONCATENATE ||
+ load_mode == LOADMODE_PASTE ||
+ load_mode == LOADMODE_NESTED ) {
//PRINT_TRACE
// The point of this is to shift forward labels after the selection so they can
// then be shifted back to their original locations without recursively
// shifting back every paste.
- if((load_mode == LOADMODE_PASTE ||
- load_mode == LOADMODE_NESTED) &&
- edl->session->labels_follow_edits)
+ if( (load_mode == LOADMODE_PASTE || load_mode == LOADMODE_NESTED) &&
+ edl->session->labels_follow_edits )
edl->labels->clear(edl->local_session->get_selectionstart(),
edl->local_session->get_selectionend(),
1);
Track *current = first_track ? first_track : edl->tracks->first;
- for( ; current; current = NEXT)
- {
- if(current->record)
- {
+ for( ; current; current = NEXT) {
+ if( current->record ) {
destination_tracks.append(current);
}
}
}
//PRINT_TRACE
-
-
-
-
int destination_track = 0;
double *paste_position = new double[destination_tracks.total];
-
-
-
-
// Iterate through the edls
- for(int i = 0; i < new_edls->total; i++)
- {
+ for( int i = 0; i < new_edls->total; i++ ) {
EDL *new_edl = new_edls->values[i];
double edl_length = new_edl->local_session->clipboard_length ?
// new_edl->local_session->clipboard_length,
// new_edl->tracks->total_length());
// new_edl->dump();
-
-
-
//PRINT_TRACE
// Convert EDL to master rates
edl->session->frame_rate,
TRACK_VIDEO);
//PRINT_TRACE
-
-
-
-
// Add assets and prepare index files
- for(Asset *new_asset = new_edl->assets->first;
- new_asset;
- new_asset = new_asset->next)
- {
+ for( Asset *new_asset = new_edl->assets->first;
+ new_asset;
+ new_asset = new_asset->next ) {
mainindexes->add_next_asset(0, new_asset);
}
// Capture index file status from mainindex test
edl->update_assets(new_edl);
//PRINT_TRACE
-
-
-
// Get starting point of insertion. Need this to paste labels.
- switch(load_mode)
- {
- case LOADMODE_REPLACE:
- case LOADMODE_NEW_TRACKS:
- current_position = 0;
- break;
-
- case LOADMODE_CONCATENATE:
- case LOADMODE_REPLACE_CONCATENATE:
- destination_track = 0;
- if(destination_tracks.total)
- current_position = destination_tracks.values[0]->get_length();
- else
- current_position = 0;
- break;
-
- case LOADMODE_PASTE:
- case LOADMODE_NESTED:
- destination_track = 0;
- if(i == 0)
- {
- for(int j = 0; j < destination_tracks.total; j++)
- {
- paste_position[j] = (current_position >= 0) ?
- current_position :
- edl->local_session->get_selectionstart();
- }
+ switch( load_mode ) {
+ case LOADMODE_REPLACE:
+ case LOADMODE_NEW_TRACKS:
+ current_position = 0;
+ break;
+
+ case LOADMODE_CONCATENATE:
+ case LOADMODE_REPLACE_CONCATENATE:
+ destination_track = 0;
+ if( destination_tracks.total )
+ current_position = destination_tracks.values[0]->get_length();
+ else
+ current_position = 0;
+ break;
+
+ case LOADMODE_PASTE:
+ case LOADMODE_NESTED:
+ destination_track = 0;
+ if( i == 0 ) {
+ for( int j = 0; j < destination_tracks.total; j++ ) {
+ paste_position[j] = (current_position >= 0) ?
+ current_position :
+ edl->local_session->get_selectionstart();
}
- break;
+ }
+ break;
- case LOADMODE_RESOURCESONLY:
- edl->add_clip(new_edl);
- break;
+ case LOADMODE_RESOURCESONLY:
+ edl->add_clip(new_edl);
+ break;
}
-
-
-
//PRINT_TRACE
-
-
// Insert edl
- if(load_mode != LOADMODE_RESOURCESONLY)
- {
+ if( load_mode != LOADMODE_RESOURCESONLY ) {
// Insert labels
//printf("MWindow::paste_edls %f %f\n", current_position, edl_length);
- if(load_mode == LOADMODE_PASTE ||
- load_mode == LOADMODE_NESTED)
+ if( load_mode == LOADMODE_PASTE ||
+ load_mode == LOADMODE_NESTED )
edl->labels->insert_labels(new_edl->labels,
destination_tracks.total ? paste_position[0] : 0.0,
edl_length,
edit_labels);
//PRINT_TRACE
- for(Track *new_track = new_edl->tracks->first;
- new_track;
- new_track = new_track->next)
- {
+ for( Track *new_track = new_edl->tracks->first;
+ new_track;
+ new_track = new_track->next ) {
// Get destination track of same type as new_track
- for(int k = 0;
+ for( int k = 0;
k < destination_tracks.total &&
destination_tracks.values[destination_track]->data_type != new_track->data_type;
- k++, destination_track++)
- {
- if(destination_track >= destination_tracks.total - 1)
+ k++, destination_track++ ) {
+ if( destination_track >= destination_tracks.total - 1 )
destination_track = 0;
}
// Insert data into destination track
- if(destination_track < destination_tracks.total &&
- destination_tracks.values[destination_track]->data_type == new_track->data_type)
- {
+ if( destination_track < destination_tracks.total &&
+ destination_tracks.values[destination_track]->data_type == new_track->data_type ) {
Track *track = destination_tracks.values[destination_track];
// Replace default keyframes if first EDL and new tracks were created.
//printf("MWindow::paste_edls 1 %d\n", replace_default);
// Insert new track at current position
- switch(load_mode)
- {
- case LOADMODE_REPLACE_CONCATENATE:
- case LOADMODE_CONCATENATE:
- current_position = track->get_length();
- break;
-
- case LOADMODE_PASTE:
- case LOADMODE_NESTED:
- current_position = paste_position[destination_track];
- paste_position[destination_track] += new_track->get_length();
- break;
+ switch( load_mode ) {
+ case LOADMODE_REPLACE_CONCATENATE:
+ case LOADMODE_CONCATENATE:
+ current_position = track->get_length();
+ break;
+
+ case LOADMODE_PASTE:
+ case LOADMODE_NESTED:
+ current_position = paste_position[destination_track];
+ paste_position[destination_track] += new_track->get_length();
+ break;
}
- if (overwrite)
+ if( overwrite ) {
track->clear(current_position,
- current_position + new_track->get_length(),
- 1, // edit edits
- edit_labels,
- edit_plugins,
- edit_autos,
- 1, // convert units
- 0); // trim edits
-
-
+ current_position + new_track->get_length(),
+ 1, // edit edits
+ edit_labels, edit_plugins, edit_autos,
+ 1, // convert units
+ 0); // trim edits
+ }
//PRINT_TRACE
- track->insert_track(new_track,
- current_position,
- replace_default,
- edit_plugins,
- edit_autos,
- edl_length);
+ track->insert_track(new_track, current_position, replace_default,
+ edit_plugins, edit_autos, edl_length);
//PRINT_TRACE
}
// Get next destination track
destination_track++;
- if(destination_track >= destination_tracks.total)
+ if( destination_track >= destination_tracks.total )
destination_track = 0;
}
}
- if(load_mode == LOADMODE_PASTE ||
- load_mode == LOADMODE_NESTED)
+ if( load_mode == LOADMODE_PASTE ||
+ load_mode == LOADMODE_NESTED )
current_position += edl_length;
}
// strange issue, for index not being shown
// Assume any paste operation from the same EDL won't contain any clips.
// If it did it would duplicate every clip here.
- for(int i = 0; i < new_edls->total; i++)
- {
+ for( int i = 0; i < new_edls->total; i++ ) {
EDL *new_edl = new_edls->values[i];
- for(int j = 0; j < new_edl->clips.total; j++)
- {
+ for( int j = 0; j < new_edl->clips.total; j++ ) {
edl->add_clip(new_edl->clips.values[j]);
}
- if(new_edl->total_vwindow_edls())
- {
-// if(edl->vwindow_edl)
+ if( new_edl->total_vwindow_edls() ) {
+// if( edl->vwindow_edl )
// edl->vwindow_edl->Garbage::remove_user();
// edl->vwindow_edl = new EDL(edl);
// edl->vwindow_edl->create_objects();
// edl->vwindow_edl->copy_all(new_edl->vwindow_edl);
- for(int j = 0; j < new_edl->total_vwindow_edls(); j++)
- {
+ for( int j = 0; j < new_edl->total_vwindow_edls(); j++ ) {
EDL *vwindow_edl = new EDL(edl);
vwindow_edl->create_objects();
vwindow_edl->copy_all(new_edl->get_vwindow_edl(j));
}
}
-
- if(paste_position) delete [] paste_position;
-
+ if( paste_position ) delete [] paste_position;
// This is already done in load_filenames and everything else that uses paste_edls
// update_project(load_mode);
// Fix preview range
-// if(EQUIV(original_length, original_preview_end))
+// if( EQUIV(original_length, original_preview_end) )
// {
// edl->local_session->preview_end = edl->tracks->total_playable_length();
// }
-
// Start examining next batch of index files
mainindexes->start_build();
-
// Don't save a backup after loading since the loaded file is on disk already.
-
-
//PRINT_TRACE
return 0;
}
double start = edl->local_session->get_selectionstart();
double end = edl->local_session->get_selectionend();
undo->update_undo_before();
- edl->paste_silence(start,
- end,
+ edl->paste_silence(start, end,
edl->session->labels_follow_edits,
edl->session->plugins_follow_edits,
edl->session->autos_follow_edits);
restart_brender();
gui->update(1, 2, 1, 1, 1, 1, 0);
cwindow->update(1, 0, 0, 0, 1);
- cwindow->playback_engine->que->send_command(CURRENT_FRAME,
- CHANGE_EDL,
- edl,
- 1);
+ cwindow->playback_engine->que->
+ send_command(CURRENT_FRAME, CHANGE_EDL, edl, 1);
}
void MWindow::detach_transition(Transition *transition)
save_backup();
undo->update_undo_after(_("detach transition"), LOAD_ALL);
- if(is_video) restart_brender();
- gui->update(0,
- 1,
- 0,
- 0,
- 0,
- 0,
- 0);
+ if( is_video ) restart_brender();
+ gui->update(0, 1, 0, 0, 0, 0, 0);
sync_parameters(CHANGE_EDL);
}
PluginServer *server = session->drag_pluginservers->values[0];
undo->update_undo_before();
- if(server->audio)
+ if( server->audio )
strcpy(edl->session->default_atransition, server->title);
else
strcpy(edl->session->default_vtransition, server->title);
save_backup();
undo->update_undo_after(_("transition"), LOAD_EDITS);
- if(server->video) restart_brender();
+ if( server->video ) restart_brender();
sync_parameters(CHANGE_ALL);
}
{
PluginServer *server = scan_plugindb(edl->session->default_atransition,
TRACK_AUDIO);
- if(!server)
- {
+ if( !server ) {
char string[BCTEXTLEN];
sprintf(string, _("No default transition %s found."), edl->session->default_atransition);
gui->show_message(string);
{
PluginServer *server = scan_plugindb(edl->session->default_vtransition,
TRACK_VIDEO);
- if(!server)
- {
+ if( !server ) {
char string[BCTEXTLEN];
sprintf(string, _("No default transition %s found."), edl->session->default_vtransition);
gui->show_message(string);
calling_window_gui->unlock_window();
- cwindow->playback_engine->que->send_command(STOP,
- CHANGE_NONE,
- 0,
- 0);
+ cwindow->playback_engine->que->
+ send_command(STOP, CHANGE_NONE, 0, 0);
cwindow->playback_engine->interrupt_playback(0);
- for(int i = 0; i < vwindows.size(); i++)
- {
- if(vwindows.get(i)->is_running())
- {
- vwindows.get(i)->playback_engine->que->send_command(STOP,
- CHANGE_NONE,
- 0,
- 0);
+ for( int i = 0; i < vwindows.size(); i++ ) {
+ if( vwindows.get(i)->is_running() ) {
+ vwindows.get(i)->playback_engine->que->
+ send_command(STOP, CHANGE_NONE, 0, 0);
vwindows.get(i)->playback_engine->interrupt_playback(0);
}
}
cwindow->gui->lock_window("MWindow::redo_entry");
- for(int i = 0; i < vwindows.size(); i++)
- {
- if(vwindows.get(i)->is_running())
- {
- if (calling_window_gui != vwindows.get(i)->gui)
- {
+ for( int i = 0; i < vwindows.size(); i++ ) {
+ if( vwindows.get(i)->is_running() ) {
+ if( calling_window_gui != vwindows.get(i)->gui ) {
vwindows.get(i)->gui->lock_window("MWindow::redo_entry 2");
}
}
gui->update(1, 2, 1, 1, 1, 1, 1);
cwindow->update(1, 1, 1, 1, 1);
- if (calling_window_gui != cwindow->gui)
+ if( calling_window_gui != cwindow->gui )
cwindow->gui->unlock_window();
- if (calling_window_gui != gui)
+ if( calling_window_gui != gui )
gui->unlock_window();
- for(int i = 0; i < vwindows.size(); i++)
- {
- if(vwindows.get(i)->is_running())
- {
- if (calling_window_gui != vwindows.get(i)->gui)
- {
+ for( int i = 0; i < vwindows.size(); i++ ) {
+ if( vwindows.get(i)->is_running() ) {
+ if( calling_window_gui != vwindows.get(i)->gui ) {
vwindows.get(i)->gui->unlock_window();
}
}
}
- cwindow->playback_engine->que->send_command(CURRENT_FRAME,
- CHANGE_ALL,
- edl,
- 1);
-
+ cwindow->playback_engine->que->
+ send_command(CURRENT_FRAME, CHANGE_ALL, edl, 1);
}
save_backup();
undo->update_undo_after(_("in point"), LOAD_TIMEBAR);
- if(!is_mwindow)
- {
+ if( !is_mwindow ) {
gui->lock_window("MWindow::set_inpoint 1");
}
gui->update_timebar(1);
- if(!is_mwindow)
- {
+ if( !is_mwindow ) {
gui->unlock_window();
}
- if(is_mwindow)
- {
+ if( is_mwindow ) {
cwindow->gui->lock_window("MWindow::set_inpoint 2");
}
cwindow->gui->timebar->update(1);
- if(is_mwindow)
- {
+ if( is_mwindow ) {
cwindow->gui->unlock_window();
}
}
save_backup();
undo->update_undo_after(_("out point"), LOAD_TIMEBAR);
- if(!is_mwindow)
- {
+ if( !is_mwindow ) {
gui->lock_window("MWindow::set_outpoint 1");
}
gui->update_timebar(1);
- if(!is_mwindow)
- {
+ if( !is_mwindow ) {
gui->unlock_window();
}
- if(is_mwindow)
- {
+ if( is_mwindow ) {
cwindow->gui->lock_window("MWindow::set_outpoint 2");
}
cwindow->gui->timebar->update(1);
- if(is_mwindow)
- {
+ if( is_mwindow ) {
cwindow->gui->unlock_window();
}
}
FileXML file;
undo->update_undo_before();
- source->copy(source->local_session->get_selectionstart(),
- source->local_session->get_selectionend(),
- 1,
- 0,
- 0,
- &file,
- "",
- 1);
-
-
-
+ double source_start = source->local_session->get_selectionstart();
+ double source_end = source->local_session->get_selectionend();
+ source->copy(source_start, source_end, 1, 0, 0, &file, "", 1);
//file.dump();
double start = edl->local_session->get_selectionstart();
//double end = edl->local_session->get_selectionend();
- double source_start = source->local_session->get_selectionstart();
- double source_end = source->local_session->get_selectionend();
- paste(start,
- start,
- &file,
+ paste(start, start, &file,
edl->session->labels_follow_edits,
edl->session->plugins_follow_edits,
edl->session->autos_follow_edits);
// Position at end of clip
- edl->local_session->set_selectionstart(start +
- source_end -
- source_start);
- edl->local_session->set_selectionend(start +
- source_end -
- source_start);
+ edl->local_session->set_selectionstart(start + source_end - source_start);
+ edl->local_session->set_selectionend(start + source_end - source_start);
save_backup();
undo->update_undo_after(_("splice"), LOAD_EDITS | LOAD_TIMEBAR);
sync_parameters(CHANGE_EDL);
}
-void MWindow::to_clip(EDL *edl, const char *txt)
+void MWindow::save_clip(EDL *new_edl, const char *txt)
{
- FileXML file;
- double start, end;
-
- gui->lock_window("MWindow::to_clip 1");
- start = edl->local_session->get_selectionstart();
- end = edl->local_session->get_selectionend();
-
- if(EQUIV(end, start)) {
- start = 0;
- end = edl->tracks->total_length();
- }
-
-// Don't copy all since we don't want the clips twice.
- edl->copy(start, end, 0, 0, 0, &file, "", 1);
-
- EDL *new_edl = new EDL(edl);
- new_edl->create_objects();
- new_edl->load_xml(&file, LOAD_ALL);
- sprintf(new_edl->local_session->clip_title, _("Clip %d"), session->clip_number++);
+ new_edl->local_session->set_selectionstart(0);
+ new_edl->local_session->set_selectionend(0);
+ sprintf(new_edl->local_session->clip_title, _("Clip %d"),
+ session->clip_number++);
char duration[BCTEXTLEN];
- Units::totext(duration, end - start,
- edl->session->time_format,
- edl->session->sample_rate,
- edl->session->frame_rate,
- edl->session->frames_per_foot);
+ Units::totext(duration, new_edl->tracks->total_length(),
+ new_edl->session->time_format,
+ new_edl->session->sample_rate,
+ new_edl->session->frame_rate,
+ new_edl->session->frames_per_foot);
+ Track *track = new_edl->tracks->first;
const char *path = edl->path;
- Track *track=edl->tracks->first;
- for(; (!path || !*path) && track; track=track->next ) {
+ for( ; (!path || !*path) && track; track=track->next ) {
if( !track->record ) continue;
- Edit *edit = track->edits->editof(start, PLAY_FORWARD, 0);
+ Edit *edit = track->edits->first;
if( !edit ) continue;
Indexable *indexable = edit->get_source();
if( !indexable ) continue;
}
cp[n] = 0;
- new_edl->local_session->set_selectionstart(0);
- new_edl->local_session->set_selectionend(0);
-
+ edl->update_assets(new_edl);
gui->unlock_window();
awindow->clip_edit->create_clip(new_edl);
- gui->lock_window("MWindow::to_clip 2");
+ gui->lock_window("MWindow::save_clip");
save_backup();
- gui->unlock_window();
}
-void MWindow::to_clip(const char *txt)
+
+void MWindow::to_clip(EDL *edl, const char *txt)
{
- to_clip(edl, txt);
+ FileXML file;
+ double start, end;
+
+ gui->lock_window("MWindow::to_clip 1");
+ start = edl->local_session->get_selectionstart();
+ end = edl->local_session->get_selectionend();
+
+ if( EQUIV(end, start) ) {
+ start = 0;
+ end = edl->tracks->total_length();
+ }
+
+// Don't copy all since we don't want the clips twice.
+ edl->copy(start, end, 0, 0, 0, &file, "", 1);
+
+ EDL *new_edl = new EDL(edl);
+ new_edl->create_objects();
+ new_edl->load_xml(&file, LOAD_ALL);
+ save_clip(new_edl, txt);
+ gui->unlock_window();
}
int MWindow::toggle_label(int is_mwindow)
double position1, position2;
undo->update_undo_before();
- if(cwindow->playback_engine->is_playing_back)
- {
+ if( cwindow->playback_engine->is_playing_back ) {
position1 = position2 =
cwindow->playback_engine->get_tracking_position();
}
- else
- {
+ else {
position1 = edl->local_session->get_selectionstart(1);
position2 = edl->local_session->get_selectionend(1);
}
edl->labels->toggle_label(position1, position2);
save_backup();
- if(!is_mwindow)
- {
+ if( !is_mwindow ) {
gui->lock_window("MWindow::toggle_label 1");
}
gui->update_timebar(0);
gui->activate_timeline();
gui->flush();
- if(!is_mwindow)
- {
+ if( !is_mwindow ) {
gui->unlock_window();
}
- if(is_mwindow)
- {
+ if( is_mwindow ) {
cwindow->gui->lock_window("MWindow::toggle_label 2");
}
cwindow->gui->timebar->update(1);
- if(is_mwindow)
- {
+ if( is_mwindow ) {
cwindow->gui->unlock_window();
}
gui->update(1, 2, 1, 1, 1, 1, 0);
cwindow->update(1, 0, 0, 0, 1);
restart_brender();
- cwindow->playback_engine->que->send_command(CURRENT_FRAME,
- CHANGE_EDL,
- edl,
- 1);
+ cwindow->playback_engine->que->
+ send_command(CURRENT_FRAME, CHANGE_EDL, edl, 1);
}
-
void MWindow::undo_entry(BC_WindowBase *calling_window_gui)
{
calling_window_gui->unlock_window();
- cwindow->playback_engine->que->send_command(STOP,
- CHANGE_NONE,
- 0,
- 0);
+ cwindow->playback_engine->que->
+ send_command(STOP, CHANGE_NONE, 0, 0);
cwindow->playback_engine->interrupt_playback(0);
//printf("MWindow::undo_entry %d %d\n", __LINE__, vwindows.size());
- for(int i = 0; i < vwindows.size(); i++)
- {
- if(vwindows.get(i)->is_running())
- {
- vwindows.get(i)->playback_engine->que->send_command(STOP,
- CHANGE_NONE,
- 0,
- 0);
+ for( int i = 0; i < vwindows.size(); i++ ) {
+ if( vwindows.get(i)->is_running() ) {
+ vwindows.get(i)->playback_engine->que->
+ send_command(STOP, CHANGE_NONE, 0, 0);
vwindows.get(i)->playback_engine->interrupt_playback(0);
}
}
cwindow->gui->lock_window("MWindow::undo_entry 1");
- for(int i = 0; i < vwindows.size(); i++)
- {
- if(vwindows.get(i)->is_running())
- {
- if (calling_window_gui != vwindows.get(i)->gui)
- {
+ for( int i = 0; i < vwindows.size(); i++ ) {
+ if( vwindows.get(i)->is_running() ) {
+ if( calling_window_gui != vwindows.get(i)->gui ) {
vwindows.get(i)->gui->lock_window("MWindow::undo_entry 4");
}
}
update_plugin_states();
update_plugin_guis();
-
-
gui->update(1, 2, 1, 1, 1, 1, 1);
-
gui->unlock_window();
-
cwindow->update(1, 1, 1, 1, 1);
-
cwindow->gui->unlock_window();
- for(int i = 0; i < vwindows.size(); i++)
- {
- if(vwindows.get(i)->is_running())
- {
- if (calling_window_gui != vwindows.get(i)->gui)
- {
+ for( int i = 0; i < vwindows.size(); i++ ) {
+ if( vwindows.get(i)->is_running() ) {
+ if( calling_window_gui != vwindows.get(i)->gui ) {
vwindows.get(i)->gui->unlock_window();
}
}
}
- if (calling_window_gui != gui)
+ if( calling_window_gui != gui )
gui->unlock_window();
-
awindow->gui->async_update_assets();
- cwindow->playback_engine->que->send_command(CURRENT_FRAME,
- CHANGE_ALL,
- edl,
- 1);
+ cwindow->playback_engine->que->
+ send_command(CURRENT_FRAME, CHANGE_ALL, edl, 1);
calling_window_gui->lock_window("MWindow::undo_entry 4");
}
-
void MWindow::new_folder(const char *new_folder)
{
undo->update_undo_before();
// Que the CWindow
cwindow->update(1, 0, 0, 0, 1);
-
update_plugin_guis();
gui->update_patchbay();
gui->hide_cursor(0);
{
int current_channel = 0;
int current_track = 0;
- for(Track *current = edl->tracks->first; current; current = NEXT)
- {
- if(current->data_type == TRACK_AUDIO &&
- current->record)
- {
+ for( Track *current = edl->tracks->first; current; current = NEXT ) {
+ if( current->data_type == TRACK_AUDIO &&
+ current->record ) {
Autos *pan_autos = current->automation->autos[AUTOMATION_PAN];
PanAuto *pan_auto = (PanAuto*)pan_autos->get_auto_for_editing(-1);
- for(int i = 0; i < MAXCHANNELS; i++)
- {
+ for( int i = 0; i < MAXCHANNELS; i++ ) {
pan_auto->values[i] = 0.0;
}
- if(pattern == MWindow::AUDIO_1_TO_1)
- {
+ if( pattern == MWindow::AUDIO_1_TO_1 ) {
pan_auto->values[current_channel] = 1.0;
}
else
- if(pattern == MWindow::AUDIO_5_1_TO_2)
- {
- switch(current_track)
- {
- case 0:
- pan_auto->values[0] = 0.5;
- pan_auto->values[1] = 0.5;
- break;
- case 1:
- pan_auto->values[0] = 1;
- break;
- case 2:
- pan_auto->values[1] = 1;
- break;
- case 3:
- pan_auto->values[0] = 1;
- break;
- case 4:
- pan_auto->values[1] = 1;
- break;
- case 5:
- pan_auto->values[0] = 0.5;
- pan_auto->values[1] = 0.5;
- break;
+ if( pattern == MWindow::AUDIO_5_1_TO_2 ) {
+ switch( current_track ) {
+ case 0:
+ pan_auto->values[0] = 0.5;
+ pan_auto->values[1] = 0.5;
+ break;
+ case 1:
+ pan_auto->values[0] = 1;
+ break;
+ case 2:
+ pan_auto->values[1] = 1;
+ break;
+ case 3:
+ pan_auto->values[0] = 1;
+ break;
+ case 4:
+ pan_auto->values[1] = 1;
+ break;
+ case 5:
+ pan_auto->values[0] = 0.5;
+ pan_auto->values[1] = 0.5;
+ break;
}
}
BC_Pan::calculate_stick_position(edl->session->audio_channels,
- edl->session->achannel_positions,
- pan_auto->values,
- MAX_PAN,
- PAN_RADIUS,
- pan_auto->handle_x,
- pan_auto->handle_y);
+ edl->session->achannel_positions, pan_auto->values,
+ MAX_PAN, PAN_RADIUS, pan_auto->handle_x, pan_auto->handle_y);
current_channel++;
current_track++;
- if(current_channel >= edl->session->audio_channels)
+ if( current_channel >= edl->session->audio_channels )
current_channel = 0;
}
}
mainclock->update(mwindow->edl->local_session->get_selectionstart(1));
}
-int MWindowGUI::cursor_enter_event()
-{
- reset_default_message();
- return 0;
-}
-
int MWindowGUI::focus_in_event()
{
for(int i = 0; i < TOTAL_PANES; i++)
void set_meter_format(int mode, int min, int max);
int translation_event();
- int cursor_enter_event();
int resize_event(int w, int h); // handle a resize event
int button_release_event();
int keypress_event();
asset.width = edl->session->output_w;
asset.height = edl->session->output_h;
asset.interlace_mode = edl->session->interlace_mode;
- asset.tcstart = (int64_t) (edl->session->get_frame_offset() +
- edl->local_session->get_selectionstart() *
- edl->session->frame_rate);
- asset.tcend = (int64_t) (edl->session->get_frame_offset() +
- edl->local_session->get_selectionend() *
- edl->session->frame_rate);
}
else
{
asset.video_data = 0;
asset.layers = 0;
- asset.tcstart = 0;
- asset.tcend = 0;
}
if(asset.audio_data &&
{
asset.audio_data = 1;
asset.channels = edl->session->audio_channels;
- asset.tcstart = (int64_t) (edl->session->get_frame_offset() +
- edl->local_session->get_selectionstart() *
- edl->session->sample_rate);
- asset.tcend = (int64_t) (edl->session->get_frame_offset() +
- edl->local_session->get_selectionend() *
- edl->session->sample_rate);
}
else
{
asset.audio_data = 0;
asset.channels = 0;
- asset.tcstart = 0;
- asset.tcend = 0;
}
if(!asset.audio_data &&
if (this->is_event_win() && get_buttonpress() == 3) {
if (label)
- timebar->label_edit->edit_label(label);
+ timebar->label_edit->start(label);
result = 1;
} else {
result = BC_Toggle::button_press_event();
vwindow->gui->lock_window("VTracking::update_tracker");
vwindow->get_edl()->local_session->set_selectionstart(position);
vwindow->get_edl()->local_session->set_selectionend(position);
-
- Asset *asset = vwindow->get_edl()->assets->first;
- if( asset && asset->tcstart ) {
- double rate = asset->video_data ? asset->frame_rate :
- asset->audio_data ? asset->sample_rate : 0;
- if( rate > 0 )
- position += asset->tcstart / rate;
- }
vwindow->gui->clock->update(position);
-
// This is going to boost the latency but we need to update the timebar
vwindow->gui->timebar->update(1);
-
vwindow->gui->unlock_window();
-
update_meters((int64_t)(position * mwindow->edl->session->sample_rate));
}
1);
double position = edl->local_session->get_selectionstart(1);
- Asset *asset = edl->assets->first;
- if( asset && asset->tcstart ) {
- double rate = asset->video_data ? asset->frame_rate :
- asset->audio_data ? asset->sample_rate : 0;
- if( rate > 0 )
- position += asset->tcstart / rate;
- }
-
if(lock_window) gui->lock_window("VWindow::update_position");
gui->clock->update(position);
if(lock_window) gui->unlock_window();
CHECK_WITH([plugin-dir],[plugin install dir],[PLUGIN_DIR],[auto])
CHECK_WITH([ladspa-dir],[ladspa install dir],[LADSPA_DIR],[auto])
CHECK_WITH([config-dir],[.bcast config dir],[CONFIG_DIR],[$$HOME/.bcast5])
+CHECK_WITH([browser],[cin_browser path],[CIN_BROWSER],[firefox])
if test "x$WANT_CINBIN_BUILD" = "xyes"; then
WANT_LOCALE_DIR='$$CIN_LIB/locale'
echo " using: with-cinlib = $WANT_CINLIB_DIR"
echo " using: with-cindat = $WANT_CINDAT_DIR"
echo " using: with-config-dir = $WANT_CONFIG_DIR"
+echo " using: with-browser = $WANT_CIN_BROWSER"
echo " using: with-plugin-dir = $WANT_PLUGIN_DIR"
echo " using: with-ladspa-dir = $WANT_LADSPA_DIR"
echo ""
echo "CFLAGS += '-DPLUGIN_DIR=\"$WANT_PLUGIN_DIR\"'"
echo "CFLAGS += '-DLOCALE_DIR=\"$WANT_LOCALE_DIR\"'"
echo "CFLAGS += '-DLADSPA_DIR=\"$WANT_LADSPA_DIR\"'"
+echo "CFLAGS += '-DCIN_BROWSER=\"$WANT_CIN_BROWSER\"'"
for flg in $CFG_CFLAGS; do echo "CFLAGS += $flg"; done
echo ""
for flg in $CFG_CXXFLAGS; do echo "CXXFLAGS += $flg"; done
int BC_FileBox::submit_file(const char *path, int use_this)
{
+ char path1[BCTEXTLEN];
+ strcpy(path1, path);
+ char *cp = strchr(path1,'\n');
+ if( cp ) *cp = 0;
+
// Deactivate textbox to hide suggestions
textbox->deactivate();
// If file wanted, take the current directory as the desired file.
// If directory wanted, ignore it.
- if(!path[0] && !want_directory)
+ if(!path1[0] && !want_directory)
{
// save complete path
strcpy(this->current_path, directory);
}
// is a directory, change directories
- if(fs->is_dir(path) && !use_this)
+ if(fs->is_dir(path1) && !use_this)
{
- fs->change_dir(path, 0);
+ fs->change_dir(path1, 0);
refresh(1);
directory_title->update(fs->get_current_dir());
strcpy(this->current_path, fs->get_current_dir());
// Is a file or desired directory. Quit the operation.
{
char path2[BCTEXTLEN];
- strcpy(path2, path);
+ strcpy(path2, path1);
// save directory for defaults
fs->extract_dir(directory, path2);
strcpy(path, directory);
// enfore one trailing slash
char *cp = path;
- while( *cp ) ++cp;
+ while( *cp && *cp != '\n' ) ++cp;
while( cp > path && *(cp-1) == '/' ) --cp;
*cp++ = '/'; *cp = 0;
wide_encoding = little_endian ? "UTF32LE" : "UTF32BE";
use_xvideo = 1;
-#include "images/file_film_png.h"
#include "images/file_folder_png.h"
-#include "images/file_sound_png.h"
#include "images/file_unknown_png.h"
+#include "images/file_film_png.h"
+#include "images/file_sound_png.h"
+#include "images/file_label_png.h"
#include "images/file_column_png.h"
static VFrame* default_type_to_icon[] =
{
new VFramePng(file_unknown_png),
new VFramePng(file_film_png),
new VFramePng(file_sound_png),
+ new VFramePng(file_label_png),
new VFramePng(file_column_png)
};
type_to_icon = default_type_to_icon;
#define ICON_UNKNOWN 1 // Private bitmap
#define ICON_FILM 2 // Private bitmap
#define ICON_SOUND 3 // Private bitmap
-#define ICON_COLUMN 4 // Private bitmap
+#define ICON_LABEL 4 // Private bitmap
+#define ICON_COLUMN 5 // Private bitmap
#endif
#include "bcbitmap.h"
#include "bcbutton.h"
#include "bcclipboard.h"
+#include "bcdialog.h"
#include "bcdragwindow.h"
#include "bclistboxitem.h"
#include "bcpan.h"
--- /dev/null
+#ifndef FILE_LABEL_PNG_H
+#define FILE_LABEL_PNG_H
+
+static unsigned char file_label_png[] =
+{
+ 0x00, 0x00, 0x05, 0x66,
+ 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
+ 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x34, 0x08, 0x06, 0x00, 0x00, 0x00, 0xc5, 0x78, 0x1b,
+ 0xeb, 0x00, 0x00, 0x00, 0x06, 0x62, 0x4b, 0x47, 0x44, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0xa0,
+ 0xbd, 0xa7, 0x93, 0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x0b, 0x13, 0x00,
+ 0x00, 0x0b, 0x13, 0x01, 0x00, 0x9a, 0x9c, 0x18, 0x00, 0x00, 0x00, 0x07, 0x74, 0x49, 0x4d, 0x45,
+ 0x07, 0xe1, 0x07, 0x0f, 0x01, 0x00, 0x0e, 0x1d, 0xf5, 0xe9, 0xf1, 0x00, 0x00, 0x04, 0xf3, 0x49,
+ 0x44, 0x41, 0x54, 0x68, 0xde, 0xed, 0x58, 0xcb, 0x8b, 0x1c, 0x45, 0x1c, 0xfe, 0xbe, 0xaa, 0xee,
+ 0x19, 0x67, 0x97, 0x9d, 0xbc, 0x24, 0x11, 0xd1, 0x8b, 0x7a, 0x88, 0x20, 0x21, 0x7a, 0x49, 0x0c,
+ 0x7a, 0x10, 0xbc, 0x78, 0x49, 0x20, 0xe0, 0xc5, 0x07, 0x22, 0x1e, 0x14, 0x3c, 0xfb, 0xaf, 0xf8,
+ 0x17, 0x08, 0x41, 0xbd, 0x18, 0x0f, 0x39, 0x29, 0xe2, 0x49, 0x04, 0x0f, 0x82, 0x87, 0xec, 0x42,
+ 0xa2, 0x08, 0xba, 0x18, 0x82, 0x71, 0xb3, 0xeb, 0xce, 0xec, 0xcc, 0x74, 0xff, 0x3e, 0x0f, 0xd5,
+ 0xef, 0xed, 0xd9, 0x99, 0x8d, 0x11, 0x4c, 0xe8, 0x0f, 0x0a, 0xba, 0xab, 0xab, 0xea, 0xf7, 0x7e,
+ 0x54, 0x03, 0x1d, 0x3a, 0x74, 0xe8, 0xd0, 0xa1, 0x43, 0x87, 0x0e, 0x1d, 0x3a, 0x74, 0xe8, 0xd0,
+ 0xa1, 0xc3, 0xff, 0x11, 0x6c, 0x9b, 0x4c, 0x34, 0x95, 0xb7, 0xcd, 0x09, 0x66, 0x06, 0xc0, 0xab,
+ 0x5c, 0x95, 0x08, 0x52, 0xfe, 0x26, 0x30, 0x05, 0x24, 0x80, 0x08, 0xf3, 0x66, 0xca, 0xe6, 0x09,
+ 0x28, 0x5b, 0x65, 0x44, 0xfe, 0x92, 0x24, 0x04, 0x60, 0x80, 0x0c, 0x82, 0x41, 0x22, 0x48, 0x0b,
+ 0x87, 0xe4, 0x67, 0x26, 0x80, 0x20, 0x30, 0x27, 0xe3, 0x0d, 0xca, 0x39, 0x95, 0x01, 0x00, 0x87,
+ 0xe7, 0x1f, 0x9b, 0x27, 0x50, 0xd4, 0x36, 0xe9, 0xd3, 0x3b, 0x13, 0x4c, 0xfe, 0xdc, 0x43, 0x62,
+ 0x11, 0xe2, 0xc4, 0x0a, 0xe6, 0x1c, 0xac, 0xa6, 0x04, 0xeb, 0xe7, 0x6c, 0x20, 0x08, 0x43, 0x42,
+ 0x20, 0xe0, 0x01, 0x82, 0x61, 0x6d, 0x9a, 0x14, 0xcc, 0xc2, 0x32, 0x7a, 0x22, 0x24, 0x97, 0x8b,
+ 0x10, 0xd6, 0xe5, 0x42, 0x25, 0xd9, 0x6b, 0x41, 0xc6, 0x43, 0x19, 0x0d, 0x57, 0x50, 0xc3, 0xd2,
+ 0x02, 0x69, 0xba, 0x23, 0xec, 0x5e, 0xdf, 0x81, 0x26, 0x11, 0x8c, 0x04, 0x23, 0x20, 0x57, 0x97,
+ 0x77, 0x75, 0x8b, 0xba, 0x49, 0x6e, 0x65, 0xc2, 0x2c, 0xb3, 0xb9, 0x23, 0xcc, 0x59, 0x21, 0x44,
+ 0x14, 0x3b, 0x40, 0x0a, 0x6c, 0x28, 0x67, 0x2d, 0xd7, 0x79, 0x6e, 0x46, 0x65, 0x34, 0xb2, 0x39,
+ 0x59, 0xf1, 0x4d, 0xf0, 0xd9, 0x9a, 0x14, 0x70, 0x6e, 0x91, 0xcb, 0xd5, 0x04, 0x52, 0x3a, 0x11,
+ 0x66, 0x1b, 0x77, 0xc1, 0x3d, 0x0f, 0xc6, 0x06, 0x47, 0x04, 0x17, 0xcb, 0x04, 0x4a, 0x59, 0x3f,
+ 0x30, 0x75, 0x41, 0x58, 0x82, 0x48, 0x9d, 0x0a, 0x37, 0x66, 0x9a, 0xed, 0xe1, 0x42, 0x8d, 0xe6,
+ 0x5a, 0xa8, 0xaf, 0x63, 0x49, 0x93, 0x54, 0xb0, 0x66, 0xb1, 0x86, 0x4b, 0x09, 0x24, 0x4b, 0x0c,
+ 0xa3, 0xdf, 0xf6, 0x90, 0x8e, 0x3c, 0x18, 0xa9, 0xdc, 0x27, 0x1d, 0xcc, 0x53, 0xa6, 0xd4, 0x60,
+ 0xbc, 0xcc, 0x3d, 0x7d, 0x49, 0x3b, 0x99, 0x95, 0x56, 0x04, 0x73, 0xd7, 0x62, 0x23, 0x86, 0x4b,
+ 0x4b, 0x29, 0x26, 0x40, 0x0f, 0x98, 0x0a, 0x37, 0x27, 0xf3, 0x3d, 0xb6, 0x48, 0xa0, 0x52, 0xe3,
+ 0xb6, 0x27, 0xa4, 0x5b, 0x09, 0x90, 0xa8, 0x3a, 0x0d, 0xb1, 0x1c, 0xad, 0xd0, 0x9c, 0x67, 0x1e,
+ 0x32, 0x3f, 0x15, 0x89, 0xc1, 0xca, 0xfd, 0x3c, 0x74, 0x96, 0x2b, 0x39, 0x77, 0x96, 0xc2, 0x8d,
+ 0x05, 0x16, 0x4a, 0xe0, 0x72, 0x9c, 0x49, 0x10, 0x54, 0x61, 0xa8, 0x2a, 0xdd, 0x22, 0x77, 0xd3,
+ 0x7e, 0x57, 0x6b, 0x8d, 0xb5, 0xa5, 0xb5, 0xe4, 0x6a, 0x8f, 0x14, 0xa0, 0x88, 0x4b, 0xb9, 0x7d,
+ 0xbb, 0x76, 0xef, 0xa5, 0x6c, 0xb8, 0xd2, 0x1d, 0x6b, 0x66, 0x11, 0x0e, 0xcf, 0x48, 0x29, 0x90,
+ 0x11, 0x00, 0xfb, 0xc2, 0xc8, 0x45, 0x20, 0xae, 0xe1, 0x95, 0xcb, 0xa7, 0xb0, 0x76, 0xfe, 0x28,
+ 0x8e, 0xd8, 0xcb, 0xe8, 0xaf, 0xfe, 0x01, 0x1a, 0x60, 0x12, 0x4c, 0x28, 0x46, 0x95, 0x70, 0x31,
+ 0x0f, 0x40, 0xb1, 0xa0, 0x18, 0x50, 0x8f, 0x21, 0x4c, 0x7d, 0x36, 0x9c, 0x00, 0xcf, 0x40, 0xb6,
+ 0x18, 0x55, 0xc6, 0xb3, 0x6c, 0x47, 0x17, 0xe2, 0x88, 0xbe, 0xb4, 0x1a, 0x09, 0x98, 0xcb, 0xd6,
+ 0xcf, 0x17, 0xe8, 0xb6, 0xa4, 0x1d, 0x49, 0x7f, 0x23, 0x8e, 0x31, 0xe8, 0x4d, 0x70, 0x6a, 0xb0,
+ 0x8d, 0xe4, 0xfa, 0x07, 0x17, 0x6e, 0xfd, 0x2e, 0x7c, 0xfe, 0x19, 0x37, 0x36, 0x2e, 0xdc, 0x44,
+ 0x1a, 0x7f, 0x01, 0x56, 0x0b, 0x2c, 0x96, 0xf4, 0xa4, 0x7b, 0x52, 0xf2, 0x82, 0x6c, 0xa8, 0x03,
+ 0x53, 0xb7, 0x7b, 0xfc, 0x06, 0x7e, 0x78, 0x73, 0x1b, 0x37, 0xdf, 0x9b, 0xf5, 0x3e, 0xc1, 0x34,
+ 0x9a, 0x61, 0xba, 0xfd, 0x2d, 0x8f, 0xbd, 0xbb, 0xf5, 0xdd, 0xa7, 0x38, 0xb9, 0xfe, 0xfa, 0xe5,
+ 0x4b, 0xab, 0xab, 0x18, 0x62, 0x87, 0xd7, 0xe0, 0x7a, 0xb3, 0x39, 0xbc, 0x71, 0x9f, 0x30, 0x34,
+ 0x80, 0xca, 0xe2, 0xb1, 0xb9, 0x76, 0x29, 0xf7, 0x54, 0xdd, 0x9d, 0x8b, 0xd8, 0xb2, 0x45, 0x61,
+ 0xe4, 0x5e, 0x3b, 0x89, 0x63, 0x00, 0x30, 0x1d, 0xe3, 0xc5, 0xed, 0xfe, 0x78, 0x70, 0x69, 0xf2,
+ 0xd2, 0x0b, 0x17, 0xef, 0xea, 0xc6, 0xc5, 0xe7, 0xf0, 0xf5, 0x95, 0x6d, 0x7f, 0xe6, 0xc8, 0x13,
+ 0x3f, 0xad, 0x61, 0xba, 0xf3, 0x2b, 0x7c, 0xcf, 0xc0, 0x65, 0xb5, 0x2d, 0x06, 0x27, 0xb6, 0xfb,
+ 0xd6, 0x8e, 0x1d, 0x3e, 0xcb, 0x01, 0x78, 0x7b, 0xfb, 0xf9, 0x3b, 0xd5, 0xf7, 0x1f, 0x81, 0xb7,
+ 0x86, 0x3c, 0xb3, 0x8e, 0xa3, 0xd3, 0x13, 0xb0, 0x91, 0xab, 0x14, 0xca, 0x46, 0xdc, 0x88, 0x35,
+ 0xad, 0x9a, 0x01, 0x66, 0x0c, 0xf3, 0x4d, 0x8b, 0x30, 0x5b, 0x6b, 0x28, 0x47, 0x4d, 0x88, 0x46,
+ 0x66, 0x63, 0xe5, 0x39, 0x5e, 0xd8, 0x29, 0xb8, 0xdd, 0xc9, 0x7c, 0x8d, 0x5c, 0xbd, 0xf4, 0xf1,
+ 0xd9, 0x70, 0xe6, 0xf0, 0x55, 0x00, 0xee, 0x3e, 0x85, 0x43, 0x16, 0xf4, 0xff, 0x0d, 0xdc, 0xb9,
+ 0x47, 0x30, 0x00, 0x80, 0x5f, 0x76, 0x4b, 0x6b, 0xbd, 0x33, 0xdc, 0xfd, 0xfe, 0xea, 0x47, 0xef,
+ 0x3f, 0xcb, 0x6f, 0x3e, 0xdc, 0xd5, 0xcf, 0x5f, 0x9d, 0x41, 0x8c, 0x37, 0xd0, 0x9e, 0x12, 0xd4,
+ 0xa2, 0xd5, 0x46, 0x36, 0xc8, 0xbb, 0x83, 0x6a, 0x6d, 0x39, 0x28, 0x8e, 0x94, 0xf5, 0x72, 0xaa,
+ 0xac, 0xab, 0xed, 0x3f, 0x58, 0x5b, 0x17, 0xef, 0xea, 0x46, 0xfe, 0x72, 0x65, 0xb8, 0x79, 0x62,
+ 0x65, 0xbc, 0x89, 0xf1, 0xc0, 0x30, 0xd0, 0xda, 0x16, 0x6e, 0x6f, 0x6d, 0x62, 0xb8, 0x72, 0x16,
+ 0x36, 0x9a, 0x20, 0x8d, 0x1c, 0x2c, 0x6d, 0x2b, 0xdf, 0x6c, 0x08, 0x56, 0xb7, 0x84, 0x73, 0xd6,
+ 0x5a, 0x38, 0x2d, 0x6d, 0x53, 0x4a, 0xe5, 0xbc, 0x4c, 0x18, 0xe7, 0x2a, 0x75, 0xce, 0x87, 0xe6,
+ 0x72, 0x78, 0xee, 0xf8, 0x52, 0xcd, 0xe9, 0x4a, 0xfa, 0x97, 0xa1, 0xef, 0xd2, 0xc1, 0xc4, 0x11,
+ 0x6e, 0xb2, 0x8a, 0xe3, 0x83, 0xa7, 0x31, 0x1e, 0x4d, 0x43, 0xa3, 0xa6, 0xb6, 0x46, 0xb3, 0x29,
+ 0x4c, 0xc3, 0xff, 0x9b, 0x96, 0x50, 0xb3, 0x37, 0xb2, 0x96, 0x33, 0xb3, 0x33, 0x8a, 0x46, 0xc5,
+ 0xf2, 0x46, 0x71, 0x19, 0xd4, 0xaf, 0x0f, 0xd3, 0x29, 0x81, 0x31, 0x90, 0x78, 0x5f, 0x06, 0x38,
+ 0xca, 0x6c, 0xe5, 0x5c, 0xbd, 0x71, 0x4b, 0xe5, 0xc1, 0x6a, 0x2a, 0x53, 0xc3, 0xd5, 0x80, 0xcc,
+ 0x12, 0xf3, 0xac, 0x9a, 0x59, 0x41, 0x56, 0xcc, 0x19, 0x38, 0xdf, 0xb5, 0x16, 0xa7, 0xfc, 0xba,
+ 0x40, 0xf1, 0x51, 0xc3, 0x74, 0x54, 0x69, 0xd3, 0x49, 0x44, 0x2e, 0xcd, 0x3a, 0x12, 0x66, 0x2e,
+ 0x57, 0x1e, 0x4a, 0xa5, 0x2d, 0xfd, 0x57, 0xd3, 0x83, 0xb8, 0xa0, 0xa3, 0xcd, 0x93, 0xad, 0x6a,
+ 0xbd, 0xe9, 0x3d, 0xb6, 0x56, 0x45, 0x22, 0xf8, 0xf2, 0x08, 0x9f, 0x61, 0xfc, 0xd4, 0xa3, 0x48,
+ 0x06, 0xbe, 0xae, 0xbd, 0xd8, 0xc2, 0x75, 0xc2, 0x1f, 0xa2, 0x18, 0x1e, 0xf8, 0x8d, 0x15, 0xba,
+ 0xc1, 0xb5, 0x14, 0x39, 0x28, 0x22, 0x14, 0xfd, 0xfb, 0x2c, 0xb7, 0x6f, 0xa6, 0x77, 0x72, 0x05,
+ 0x10, 0xe1, 0x4d, 0x70, 0x91, 0x81, 0x04, 0x1c, 0x05, 0x4f, 0x0b, 0x95, 0xbf, 0x56, 0x3f, 0xb2,
+ 0x8e, 0x40, 0xf9, 0x45, 0x3a, 0xdc, 0x9d, 0x98, 0x07, 0xb5, 0xca, 0xef, 0x90, 0x15, 0xf7, 0x36,
+ 0x52, 0x70, 0x0e, 0xc5, 0xd9, 0xf0, 0x02, 0x9d, 0x40, 0x08, 0xce, 0x85, 0x67, 0x9f, 0x8d, 0x22,
+ 0x94, 0x18, 0xae, 0x35, 0x3c, 0xb8, 0xba, 0xef, 0x13, 0x88, 0x83, 0x27, 0xfb, 0x0f, 0xf2, 0x5f,
+ 0x9f, 0x76, 0x1b, 0xf7, 0x8f, 0xf7, 0xa0, 0xdb, 0x23, 0x18, 0x1c, 0x2c, 0xa9, 0x5c, 0x02, 0x1b,
+ 0xb7, 0x3c, 0xb6, 0x64, 0x3e, 0x86, 0xdf, 0x40, 0xc1, 0x4a, 0xc8, 0xb3, 0x23, 0xcb, 0xcb, 0x6a,
+ 0x4e, 0x99, 0x21, 0xfe, 0x64, 0x02, 0x9c, 0x01, 0x69, 0x48, 0x3e, 0x65, 0x92, 0x61, 0xbd, 0x9d,
+ 0x0b, 0xe6, 0x5e, 0x54, 0x89, 0x5a, 0x05, 0x62, 0xff, 0xf4, 0x9a, 0x66, 0xeb, 0xb7, 0x30, 0xdb,
+ 0x02, 0x58, 0x35, 0x98, 0xb5, 0xc4, 0x86, 0x54, 0x61, 0xb6, 0xfc, 0x3f, 0x43, 0x86, 0x8b, 0x5f,
+ 0x99, 0x46, 0x08, 0xfa, 0xca, 0x6f, 0x30, 0x67, 0xa0, 0x63, 0xe8, 0x9d, 0x7c, 0xe5, 0x37, 0x56,
+ 0x23, 0x07, 0xe4, 0x9d, 0x12, 0x29, 0xd8, 0x62, 0x97, 0x9b, 0x1b, 0x85, 0x8c, 0x4f, 0x9f, 0x7a,
+ 0x10, 0x5d, 0xce, 0xe1, 0x21, 0xc3, 0x43, 0x27, 0x50, 0x87, 0x0e, 0x1d, 0x3a, 0x74, 0x78, 0xa0,
+ 0xf0, 0x0f, 0x45, 0x8d, 0x61, 0x75, 0x3d, 0x5b, 0x54, 0xb2, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45,
+ 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82
+};
+
+#endif