--enable-libogg=auto --enable-libtheora=auto --enable-libvorbis=auto \
--enable-openexr=auto --enable-libsndfile=auto --enable-libdv=auto \
--enable-libjpeg=auto --enable-tiff=auto --enable-x264=auto \
- --disable-audiofile --disable-encore --disable-esound --disable-fdk \
+ --enable-audiofile --disable-encore --disable-esound --disable-fdk \
--disable-ffmpeg --disable-fftw --disable-flac --disable-giflib --disable-ilmbase \
--disable-libavc1394 --disable-libraw1394 --disable-libiec61883 --disable-libvpx \
--disable-openjpeg --disable-twolame --disable-x265
void Asset::copy_location(Asset *asset)
{
strcpy(path, asset->path);
- awindow_folder = asset->awindow_folder;
+ folder_no = asset->folder_no;
}
void Asset::copy_format(Asset *asset, int do_index)
else
if(file->tag.title_is("FOLDER"))
{
- awindow_folder = file->tag.get_property("NUMBER", AW_MEDIA_FOLDER);
+ folder_no = file->tag.get_property("NUMBER", AW_MEDIA_FOLDER);
}
else
if(file->tag.title_is("VIDEO"))
file->append_newline();
file->tag.set_title("FOLDER");
- file->tag.set_property("NUMBER", awindow_folder);
+ file->tag.set_property("NUMBER", folder_no);
file->append_tag();
file->tag.set_title("/FOLDER");
file->append_tag();
file.close_file();
}
if( !ret ) {
- asset->awindow_folder = AW_MEDIA_FOLDER;
+ asset->folder_no = AW_MEDIA_FOLDER;
mwindow->edl->assets->append(asset);
mwindow->awindow->gui->async_update_assets();
}
file.close_file();
}
if( !ret ) {
- asset->awindow_folder = AW_MEDIA_FOLDER;
+ asset->folder_no = AW_MEDIA_FOLDER;
mwindow->edl->assets->append(asset);
mwindow->awindow->gui->async_update_assets();
}
icon_vframe = new VFrame(0,
-1, pixmap_w, pixmap_h, BC_RGB888, -1);
icon_vframe->transfer_from(gui->temp_picon);
- if( asset->awindow_folder == AW_MEDIA_FOLDER ) {
+ if( asset->folder_no == AW_MEDIA_FOLDER ) {
// vicon images
double framerate = asset->get_frame_rate();
if( !framerate ) framerate = VICON_RATE;
base_colors[i], line_colors[i]);
}
mwindow->audio_cache->check_in(asset);
- if( asset->awindow_folder == AW_MEDIA_FOLDER ) {
+ if( asset->folder_no == AW_MEDIA_FOLDER ) {
double secs = duration;
if( secs > 5 ) secs = 5;
double refresh_rate = gui->vicon_thread->refresh_rate;
for( int i=0; i<new_assets.size(); ++i ) {
AssetPicon *picon = new_assets[i];
picon->create_objects();
+ if( picon->indexable )
+ picon->foldernum = AW_MEDIA_FOLDER;
+ else if( picon->edl )
+ picon->foldernum = AW_CLIP_FOLDER;
assets.append(picon);
}
if( current->data_type != TRACK_AUDIO ) continue;
current->insert_asset(unproxy_asset, 0, length, 0, atrack++);
}
- proxy_edl->awindow_folder = AW_PROXY_FOLDER;
+ proxy_edl->folder_no = AW_PROXY_FOLDER;
return proxy_edl;
}
while( (result = (AssetPicon*)asset_list->get_selection(0, i++)) != 0 ) {
Indexable *indexable = result->indexable;
if( proxy && indexable && indexable->is_asset &&
- indexable->awindow_folder == AW_PROXY_FOLDER ) {
+ indexable->folder_no == AW_PROXY_FOLDER ) {
EDL *drag_edl = collect_proxy(indexable);
if( drag_edl ) mwindow->session->drag_clips->append(drag_edl);
continue;
}
}
-void AWindowGUI::copy_picons(ArrayList<BC_ListBoxItem*> *dst,
- ArrayList<BC_ListBoxItem*> *src, int folder)
+void AWindowGUI::copy_picons(AssetPicon *picon, ArrayList<BC_ListBoxItem*> *src)
{
// Remove current pointers
+ ArrayList<BC_ListBoxItem*> *dst = displayed_assets;
dst[0].remove_all();
dst[1].remove_all_objects();
- AWindowFolderSubItems *sub_items = 0;
- if( folder >= 0 && folder < AW_LABEL_FOLDER ) {
- AssetPicon *picon = 0;
- for( int k=folders.size(); --k>=0; ) {
- picon = (AssetPicon*)folders[k];
- if( picon->foldernum == folder ) break;
- }
- if( picon )
- sub_items = picon->sub_items;
- folder = AW_NO_FOLDER;
- }
+
+ AWindowFolderSubItems *sub_items = picon ? picon->sub_items : 0;
+ int folder = mwindow->edl->session->awindow_folder;
BinFolder *bin_folder = folder < AWINDOW_USER_FOLDERS ? 0 :
mwindow->edl->get_folder(folder);
// Create new pointers
for( int i = 0; i < src->total; i++ ) {
- int visible = folder < 0 ? 1 : 0;
- AssetPicon *picon = (AssetPicon*)src->values[i];
+ int visible = folder >= AW_CLIP_FOLDER ? 0 : 1;
+ picon = (AssetPicon*)src->values[i];
picon->sort_key = -1;
if( !visible && bin_folder ) {
Indexable *idxbl = bin_folder->is_clips ? (Indexable *)picon->edl :
visible = 1;
}
}
- if( !visible && picon->indexable && picon->indexable->awindow_folder == folder )
+ if( !visible && picon->indexable && picon->indexable->folder_no == folder )
visible = 1;
- if( !visible && picon->edl && picon->edl->local_session->folder == folder )
+ if( !visible && picon->edl && picon->edl->folder_no == folder )
visible = 1;
if( visible && sub_items ) {
if( !sub_items->matches(picon->get_text()) )
//allow_iconlisting = 1;
asset_titles[0] = C_("Title");
asset_titles[1] = _("Comments");
- int folder = mwindow->edl->session->awindow_folder;
-
- switch( folder ) {
- case AW_AEFFECT_FOLDER:
- copy_picons(displayed_assets, &aeffects, folder);
- break;
- case AW_VEFFECT_FOLDER:
- copy_picons(displayed_assets, &veffects, folder);
- break;
- case AW_ATRANSITION_FOLDER:
- copy_picons(displayed_assets, &atransitions, folder);
- break;
- case AW_VTRANSITION_FOLDER:
- copy_picons(displayed_assets, &vtransitions, folder);
- break;
- case AW_LABEL_FOLDER:
- copy_picons(displayed_assets, &labellist, AW_NO_FOLDER);
- asset_titles[0] = _("Time Stamps");
- asset_titles[1] = C_("Title");
- //allow_iconlisting = 0;
- break;
- default:
- copy_picons(displayed_assets, &assets, mwindow->edl->session->awindow_folder);
- break;
- }
-
- // Ensure the current folder icon is highlighted
+ AssetPicon *picon = 0;
int selected_folder = mwindow->edl->session->awindow_folder;
+ // Ensure the current folder icon is highlighted
for( int i = 0; i < folders.total; i++ ) {
AssetPicon *folder_item = (AssetPicon *)folders.values[i];
int selected = folder_item->foldernum == selected_folder ? 1 : 0;
folder_item->set_selected(selected);
+ if( selected ) picon = folder_item;
+ }
+
+ ArrayList<BC_ListBoxItem*> *src = &assets;
+ switch( selected_folder ) {
+ case AW_AEFFECT_FOLDER: src = &aeffects; break;
+ case AW_VEFFECT_FOLDER: src = &veffects; break;
+ case AW_ATRANSITION_FOLDER: src = &atransitions; break;
+ case AW_VTRANSITION_FOLDER: src = &vtransitions; break;
+ case AW_LABEL_FOLDER: src = &labellist;
+ asset_titles[0] = _("Time Stamps");
+ asset_titles[1] = C_("Title");
+ //allow_iconlisting = 0;
+ break;
}
+ copy_picons(picon, src);
}
if( get_hidden() ) return 0;
if( mwindow->session->current_operation == DRAG_ASSET &&
gui->folder_list->cursor_above() ) { // check user folder
- int item_no = gui->folder_list->get_cursor_item();
+ int item_no = gui->folder_list->get_cursor_data_item_no();
AssetPicon *picon = (AssetPicon *)(item_no < 0 ? 0 : gui->folders[item_no]);
if( picon && picon->foldernum >= AWINDOW_USER_FOLDERS ) {
BinFolder *folder = mwindow->edl->get_folder(picon->foldernum);
lock_window("AWindowAssets::drag_motion_event");
if( mwindow->session->current_operation == DRAG_ASSET &&
gui->folder_list->cursor_above() ) { // highlight user folder
- int item_no = gui->folder_list->get_cursor_item();
+ BC_ListBoxItem *item = 0;
+ int item_no = gui->folder_list->get_cursor_data_item_no(&item);
if( item_no >= 0 ) {
AssetPicon *folder = (AssetPicon *)gui->folders[item_no];
if( folder->foldernum < AWINDOW_USER_FOLDERS ) item_no = -1;
}
+ if( item_no >= 0 )
+ item_no = gui->folder_list->item_to_index(&gui->folders, item);
int folder_xposition = gui->folder_list->get_xposition();
int folder_yposition = gui->folder_list->get_yposition();
gui->folder_list->update(&gui->folders, 0, 0, 1,
int is_realtime,
int is_transition);
void create_label_folder();
- void copy_picons(ArrayList<BC_ListBoxItem*> *dst,
- ArrayList<BC_ListBoxItem*> *src, int folder);
+ void copy_picons(AssetPicon *picon, ArrayList<BC_ListBoxItem*> *src);
void sort_picons(ArrayList<BC_ListBoxItem*> *src);
// Return the selected asset in asset_list
Indexable* selected_asset();
for( int i=0; i<n; ++i ) {
idxbl = drag_idxbls->get(i);
if( !idxbl->is_asset &&
- idxbl->awindow_folder == AW_PROXY_FOLDER )
+ idxbl->folder_no == AW_PROXY_FOLDER )
continue;
const char *tp = idxbl->get_title();
for( int i=0; i<n; ++i ) {
idxbl = drag_idxbls->get(i);
if( !idxbl->is_asset &&
- idxbl->awindow_folder == AW_PROXY_FOLDER )
+ idxbl->folder_no == AW_PROXY_FOLDER )
continue;
if( i > 0 ) *bp++ = '\n';
const char *tp = idxbl->get_title();
if( vwindow && create_it ) {
// vwindow->change_source(new_edl);
}
- }
- else {
- mwindow->session->clip_number--;
+ mwindow->session->update_clip_number();
}
// always a copy from new_gui
void ClipEDLs::add_clip(EDL *edl)
{
+ edl->folder_no = AW_CLIP_FOLDER;
append(edl);
edl->add_user();
}
EDL *clip = mwindow->session->drag_clips->values[0];
EDL *nested = edl->new_nested(clip, path);
EDL *new_clip = edl->create_nested_clip(nested);
- new_clip->awindow_folder = AW_CLIP_FOLDER;
+ new_clip->folder_no = AW_CLIP_FOLDER;
sprintf(new_clip->local_session->clip_icon,
"clip_%02d%02d%02d-%02d%02d%02d.png",
dtm.tm_year+1900, dtm.tm_mon+1, dtm.tm_mday,
EDL *new_clip = new EDL(edl);
new_clip->create_objects();
new_clip->copy_all(nested_edl);
- new_clip->awindow_folder = AW_CLIP_FOLDER;
+ new_clip->folder_no = AW_CLIP_FOLDER;
int idx = edl->clips.number_of(clip);
if( idx >= 0 ) {
edl->clips[idx] = new_clip;
ap->set_selected(found);
}
if( picon ) {
- int selected_folder = picon->indexable->awindow_folder;
+ int selected_folder = picon->indexable->folder_no;
mwindow->edl->session->awindow_folder = selected_folder;
for( int i=0,n=agui->folders.size(); i<n; ++i ) {
AssetPicon *folder_item = (AssetPicon *)agui->folders[i];
int EDL::copy_all(EDL *edl)
{
if( this == edl ) return 0;
+ folder_no = edl->folder_no;
update_index(edl);
copy_session(edl);
copy_assets(edl);
if( !session_only ) {
strcpy(this->path, edl->path);
- awindow_folder = edl->awindow_folder;
folders.copy_from(&edl->folders);
}
EDL *new_edl = new EDL(this);
new_edl->create_objects();
new_edl->copy_all(edl);
+ new_edl->folder_no = AW_CLIP_FOLDER;
clips.append(new_edl);
return new_edl;
}
rescale_proxy(orig_scale, new_scale);
// change original assets to proxy assets
- int awindow_folder = use_scaler || new_scale != 1 ? AW_PROXY_FOLDER : AW_MEDIA_FOLDER;
+ int folder_no = use_scaler || new_scale != 1 ? AW_PROXY_FOLDER : AW_MEDIA_FOLDER;
for( int i=0,n=proxy_assets->size(); i<n; ++i ) {
const char *orig_path = orig_assets->get(i)->path;
Indexable *proxy_idxbl = proxy_assets->get(i);
- proxy_idxbl->awindow_folder = awindow_folder;
+ proxy_idxbl->folder_no = folder_no;
Asset *proxy_asset = proxy_idxbl->is_asset ? assets->update((Asset *)proxy_idxbl) : 0;
if( proxy_asset && proxy_idxbl ) {
proxy_asset->width = proxy_idxbl->get_w();
// change original assets to proxy assets
for( int i=0,n=proxy_assets->size(); i<n; ++i ) {
Asset *proxy_asset = assets->update((Asset *)proxy_assets->get(i));
- proxy_asset->awindow_folder = AW_PROXY_FOLDER;
+ proxy_asset->folder_no = AW_PROXY_FOLDER;
// replace track contents
for( Track *track=tracks->first; track; track=track->next ) {
if( track->data_type != TRACK_VIDEO ) continue;
Asset *EDL::get_proxy_asset()
{
- return awindow_folder == AW_PROXY_FOLDER ?
+ return folder_no == AW_PROXY_FOLDER ?
tracks->first->edits->first->asset : 0;
}
{
index_state = new IndexState;
this->is_asset = is_asset;
- this->awindow_folder = AW_MEDIA_FOLDER;
+ this->folder_no = AW_MEDIA_FOLDER;
}
void Indexable::copy_indexable(Indexable *src)
{
if( this == src ) return;
- awindow_folder = src->awindow_folder;
+ folder_no = src->folder_no;
update_path(src->path);
update_index(src);
}
{
if( is_asset ) return path;
EDL *edl = (EDL*)this;
- if( !edl->parent_edl || awindow_folder == AW_PROXY_FOLDER ) return path;
+ if( !edl->parent_edl || folder_no == AW_PROXY_FOLDER ) return path;
return edl->local_session->clip_title;
}
// to the backup file, not the project file.
char path[BCTEXTLEN];
// Folder in resource manager
- int awindow_folder;
+ int folder_no;
int is_asset;
// unique ID of this object for comparison
selectionstart = selectionend = 0;
in_point = out_point = -1;
- folder = AW_CLIP_FOLDER;
sprintf(clip_title, _("Program"));
strcpy(clip_notes, _("Hello world"));
strcpy(clip_icon, "");
strcpy(clip_title, that->clip_title);
strcpy(clip_notes, that->clip_notes);
strcpy(clip_icon, that->clip_icon);
- folder = that->folder;
in_point = that->in_point;
loop_playback = that->loop_playback;
loop_start = that->loop_start;
file->tag.set_property("SELECTION_END", selectionend - start);
file->tag.set_property("CLIP_TITLE", clip_title);
file->tag.set_property("CLIP_ICON", clip_icon);
- file->tag.set_property("FOLDER", folder);
file->tag.set_property("X_PANE", x_pane);
file->tag.set_property("Y_PANE", y_pane);
year, mon, mday, hour, min, sec);
}
}
- int awindow_folder = file->tag.get_property("AWINDOW_FOLDER", -1);
- folder = awindow_folder >= 0 ? awindow_folder :
- file->tag.get_property("FOLDER",
- edl->parent_edl ? AW_CLIP_FOLDER : AW_MEDIA_FOLDER);
loop_playback = file->tag.get_property("LOOP_PLAYBACK", 0);
loop_start = file->tag.get_property("LOOP_START", (double)0);
loop_end = file->tag.get_property("LOOP_END", (double)0);
char clip_title[BCTEXTLEN];
char clip_notes[BCTEXTLEN];
char clip_icon[BCSTRLEN];
-// awindow folder id
- int folder;
int loop_playback;
double loop_start, loop_end;
#include "edlsession.h"
#include "guicast.h"
#include "indexable.h"
+#include "language.h"
+#include "localsession.h"
#include "mainsession.h"
#include "meterpanel.h"
#include "mwindow.h"
return track;
}
+void MainSession::update_clip_number()
+{
+ int clip_no = 0;
+ for( int i=mwindow->edl->clips.size(); --i>=0; ) {
+ EDL *clip_edl = mwindow->edl->clips[i];
+ int no = 0;
+ if( sscanf(clip_edl->local_session->clip_title,_("Clip %d"),&no) == 1 )
+ if( no > clip_no ) clip_no = no;
+ }
+ clip_number = clip_no+1;
+}
+
void default_window_positions(int window_config=0);
void boundaries();
Track *drag_handle_track();
+ void update_clip_number();
// For drag and drop events
// The entire track where the dropped asset is going to go
if(debug) PRINT_TRACE
edl->tracks->update_y_pixels(theme);
+ session->update_clip_number();
if(debug) PRINT_TRACE
"clip_%02d%02d%02d-%02d%02d%02d.png",
dtm.tm_year+1900, dtm.tm_mon+1, dtm.tm_mday,
dtm.tm_hour, dtm.tm_min, dtm.tm_sec);
- new_edl->awindow_folder = AW_CLIP_FOLDER;
+ new_edl->folder_no = AW_CLIP_FOLDER;
edl->update_assets(new_edl);
int cur_x, cur_y;
gui->get_abs_cursor(cur_x, cur_y, 0);
if( clear_it ) clear();
FileXML file;
- file.read_from_file(path);
+ file.read_from_file(path, 1);
load_common(&file, is_factory);
}
proxy->copy_format(format_asset, 0);
proxy->video_length = video_frames;
}
- proxy->awindow_folder = AW_PROXY_FOLDER;
+ proxy->folder_no = AW_PROXY_FOLDER;
proxy->audio_data = 0;
proxy->video_data = 1;
proxy->layers = 1;
AC_DEFUN([PKG_PROVIDE],[
if test "x$BUILD_$1" = "x" ; then
- if test "x$2" = "xno" -o "x$PKG_$1" = "xno"; then
- PKG_DISABLED([$1])
- elif test "x$PKG_$1" = "xyes"; then
+ if test "x$PKG_$1" = "xyes"; then
PKG_FORCED([$1])
+ elif test "x$2" = "xno" -o "x$PKG_$1" = "xno"; then
+ PKG_DISABLED([$1])
elif test "x$WANT_STATIC_BUILD" = "xyes"; then
PKG_STATIC([$1],[static])
elif test "x$HAVE_$1" = "xyes"; then
cursor_y < get_item_y(item) + get_item_h(item) ) {
//printf("BC_ListBox::get_cursor_item %d %d %p\n", master_column, i, item);
if( item_return ) (*item_return) = item;
+ if( expanded < 0 ) (*counter) = i;
return (*counter);
}
if( item->sublist_active() ) {
if( get_cursor_item(item->get_sublist(),
cursor_x, cursor_y, item_return, counter,
- item->get_expand()) >= 0 )
+ item->get_expand()) >= 0 ) {
+ if( expanded < 0 ) (*counter) = i;
return (*counter);
+ }
}
}
}
}
// short version
-int BC_ListBox::get_cursor_item()
+int BC_ListBox::get_cursor_item_no()
{
int rx, ry;
gui->get_relative_cursor(rx, ry);
return get_cursor_item(data, rx, ry, 0, 0);
}
+int BC_ListBox::get_cursor_data_item_no(BC_ListBoxItem **item_return)
+{
+ int rx, ry;
+ gui->get_relative_cursor(rx, ry);
+ return get_cursor_item(data, rx, ry, item_return, 0, -1);
+}
+
int BC_ListBox::repeat_event(int64_t duration)
{
switch( current_operation ) {
//printf("BC_ListBox::button_release_event 10\n");
current_operation = NO_OPERATION;
if( gui ) {
- selection_number1 = selection_number = get_cursor_item();
+ selection_number1 = selection_number = get_cursor_item_no();
//printf("BC_ListBox::button_release_event %d %d\n", selection_number2, selection_number1);
}
int is_active();
int expander_active();
+// get item no at current cursor position
+ int get_cursor_item_no();
+// get top data item no, and item at current cursor position
+ int get_cursor_data_item_no(BC_ListBoxItem **item_return=0);
+
int translation_event();
int repeat_event(int64_t duration);
BC_DragWindow* get_drag_popup();
// Draw the list items
int draw_items(int flash, int bg_draw=0);
int is_highlighted();
- int get_cursor_item();
private:
void delete_columns();
// Points *item_return to the first item in the row or 0 if no item was found.
// if it's nonzero. Returns -1 if no item was found. Clamps the y coordinate
// only if the current operation is not SELECT, so scrolling is possible.
-// expanded - 1 if items in this table should be tested for cursor coverage
+// expanded = 1 if items in this table should be tested for cursor coverage
+// expanded = -1 returns only the top level master column index/item
int get_cursor_item(ArrayList<BC_ListBoxItem*> *data,
int cursor_x,
int cursor_y,
if(!histval){
- for(i=0;i<ntw;i++){
- unsigned char *row = data;
- for(j=0;j<nth;j++){
- row[0] = tb_r;
- row[1] = tb_g;
- row[2] = tb_b;
- row[3] = 0xff;
- row+=bpr;
+ unsigned char *row = data;
+ for(j=0;j<nth;j++){
+ unsigned char *rp = row;
+ for(i=0;i<ntw;i++){
+ rp[0] = tb_r;
+ rp[1] = tb_g;
+ rp[2] = tb_b;
+ rp[3] = 0xff;
+ rp += bpp;
}
+ row += bpr;
}
}else{