add snapshot, igor exts, cleanup
authorGood Guy <good1.2guy@gmail.com>
Sat, 21 Oct 2017 23:13:28 +0000 (17:13 -0600)
committerGood Guy <good1.2guy@gmail.com>
Sat, 21 Oct 2017 23:13:28 +0000 (17:13 -0600)
cinelerra-5.1/cinelerra/editpopup.C
cinelerra-5.1/cinelerra/editpopup.h
cinelerra-5.1/cinelerra/interfaceprefs.C
cinelerra-5.1/cinelerra/interfaceprefs.h
cinelerra-5.1/cinelerra/interfaceprefs.inc
cinelerra-5.1/cinelerra/preferences.C
cinelerra-5.1/cinelerra/preferences.h
cinelerra-5.1/guicast/bclistbox.C
cinelerra-5.1/guicast/bcresources.C

index 4670dafdae000e7d435aff43e3e73a0fea8da3ef..fc1da9d09c7acf518e5cb0ca6e5be287ee6a5c13 100644 (file)
  *
  */
 
+#include "asset.h"
+#include "assets.h"
+#include "awindow.h"
+#include "awindowgui.h"
 #include "edit.h"
 #include "editpopup.h"
+#include "cache.h"
+#include "edl.h"
+#include "edlsession.h"
+#include "file.h"
 #include "language.h"
+#include "localsession.h"
+#include "mainerror.h"
 #include "mainsession.h"
 #include "mwindow.h"
 #include "mwindowgui.h"
 #include "plugindialog.h"
+#include "preferences.h"
+#include "renderengine.h"
 #include "resizetrackthread.h"
 #include "track.h"
 #include "tracks.h"
 #include "trackcanvas.h"
-
+#include "transportque.h"
+#include "vframe.h"
+#include "vrender.h"
 
 #include <string.h>
 
@@ -53,6 +67,13 @@ void EditPopup::create_objects()
        add_item(new EditPopupDeleteTrack(mwindow, this));
        add_item(new EditPopupAddTrack(mwindow, this));
 //     add_item(new EditPopupTitle(mwindow, this));
+       EditSnapshot *edit_snapshot;
+       SnapshotSubMenu *snapshot_submenu;
+       add_item(edit_snapshot = new EditSnapshot(mwindow, this));
+       edit_snapshot->add_submenu(snapshot_submenu = new SnapshotSubMenu(edit_snapshot));
+       snapshot_submenu->add_submenuitem(new SnapshotMenuItem(snapshot_submenu, _("png"),  SNAPSHOT_PNG));
+       snapshot_submenu->add_submenuitem(new SnapshotMenuItem(snapshot_submenu, _("jpeg"), SNAPSHOT_JPEG));
+       snapshot_submenu->add_submenuitem(new SnapshotMenuItem(snapshot_submenu, _("tiff"), SNAPSHOT_TIFF));
        resize_option = 0;
        matchsize_option = 0;
 }
@@ -100,10 +121,8 @@ EditAttachEffect::~EditAttachEffect()
 int EditAttachEffect::handle_event()
 {
        dialog_thread->start_window(popup->track,
-               0,
-               _(PROGRAM_NAME ": Attach Effect"),
-               0,
-               popup->track->data_type);
+               0, _(PROGRAM_NAME ": Attach Effect"),
+               0, popup->track->data_type);
        return 1;
 }
 
@@ -141,8 +160,6 @@ int EditMoveTrackDown::handle_event()
 }
 
 
-
-
 EditPopupResize::EditPopupResize(MWindow *mwindow, EditPopup *popup)
  : BC_MenuItem(_("Resize track..."))
 {
@@ -162,10 +179,6 @@ int EditPopupResize::handle_event()
 }
 
 
-
-
-
-
 EditPopupMatchSize::EditPopupMatchSize(MWindow *mwindow, EditPopup *popup)
  : BC_MenuItem(_("Match output size"))
 {
@@ -183,11 +196,6 @@ int EditPopupMatchSize::handle_event()
 }
 
 
-
-
-
-
-
 EditPopupDeleteTrack::EditPopupDeleteTrack(MWindow *mwindow, EditPopup *popup)
  : BC_MenuItem(_("Delete track"))
 {
@@ -201,10 +209,6 @@ int EditPopupDeleteTrack::handle_event()
 }
 
 
-
-
-
-
 EditPopupAddTrack::EditPopupAddTrack(MWindow *mwindow, EditPopup *popup)
  : BC_MenuItem(_("Add track"))
 {
@@ -229,10 +233,6 @@ int EditPopupAddTrack::handle_event()
 }
 
 
-
-
-
-
 EditPopupTitle::EditPopupTitle(MWindow *mwindow, EditPopup *popup)
  : BC_MenuItem(_("User title..."))
 {
@@ -342,7 +342,115 @@ int EditPopupTitleText::handle_event()
 
 
 
+EditSnapshot::EditSnapshot(MWindow *mwindow, EditPopup *popup)
+ : BC_MenuItem(_("Snapshot..."))
+{
+       this->mwindow = mwindow;
+       this->popup = popup;
+}
 
+EditSnapshot::~EditSnapshot()
+{
+}
+
+SnapshotSubMenu::SnapshotSubMenu(EditSnapshot *edit_snapshot)
+{
+       this->edit_snapshot = edit_snapshot;
+}
+
+SnapshotSubMenu::~SnapshotSubMenu()
+{
+}
+
+SnapshotMenuItem::SnapshotMenuItem(SnapshotSubMenu *submenu, const char *text, int mode)
+ : BC_MenuItem(text)
+{
+       this->submenu = submenu;
+       this->mode = mode;
+}
+
+SnapshotMenuItem::~SnapshotMenuItem()
+{
+}
+
+int SnapshotMenuItem::handle_event()
+{
+       MWindow *mwindow = submenu->edit_snapshot->mwindow;
+       EDL *edl = mwindow->edl;
+       if( !edl->have_video() ) return 1;
 
+       Preferences *preferences = mwindow->preferences;
+       char filename[BCTEXTLEN];
+       static const char *exts[] = { "png", "jpg", "tif" };
+       time_t tt;     time(&tt);
+       struct tm tm;  localtime_r(&tt,&tm);
+       sprintf(filename,"%s/snap_%04d%02d%02d-%02d%02d%02d.%s",
+               preferences->snapshot_path, 1900+tm.tm_year,tm.tm_mon,tm.tm_mday,
+               tm.tm_hour,tm.tm_min,tm.tm_sec, exts[mode]);
+       int fw = edl->get_w(), fh = edl->get_h();
+       int fcolor_model = edl->session->color_model;
 
+       Asset *asset = new Asset(filename);
+       switch( mode ) {
+       case SNAPSHOT_PNG:
+               asset->format = FILE_PNG;
+               asset->png_use_alpha = 1;
+               break;
+       case SNAPSHOT_JPEG:
+               asset->format = FILE_JPEG;
+               asset->jpeg_quality = 90;
+               break;
+       case SNAPSHOT_TIFF:
+               asset->format = FILE_TIFF;
+               asset->tiff_cmodel = 0;
+               asset->tiff_compression = 0;
+               break;
+       }
+       asset->width = fw;
+       asset->height = fh;
+       asset->audio_data = 0;
+       asset->video_data = 1;
+       asset->video_length = 1;
+       asset->layers = 1;
+
+       File file;
+       int processors = preferences->project_smp + 1;
+       if( processors > 8 ) processors = 8;
+       file.set_processors(processors);
+       int ret = file.open_file(preferences, asset, 0, 1);
+       if( !ret ) {
+               file.start_video_thread(1, fcolor_model,
+                       processors > 1 ? 2 : 1, 0);
+               VFrame ***frames = file.get_video_buffer();
+               VFrame *frame = frames[0][0];
+               TransportCommand command;
+               //command.command = audio_tracks ? NORMAL_FWD : CURRENT_FRAME;
+               command.command = CURRENT_FRAME;
+               command.get_edl()->copy_all(edl);
+               command.change_type = CHANGE_ALL;
+               command.realtime = 0;
+
+               RenderEngine render_engine(0, preferences, 0, 0);
+               CICache video_cache(preferences);
+               render_engine.set_vcache(&video_cache);
+               render_engine.arm_command(&command);
+
+               double position = edl->local_session->get_selectionstart(1);
+               int64_t source_position = (int64_t)(position * edl->get_frame_rate());
+               int ret = render_engine.vrender->process_buffer(frame, source_position, 0);
+               if( !ret )
+                       ret = file.write_video_buffer(1);
+               file.close_file();
+       }
+       if( !ret ) {
+               asset->awindow_folder = AW_MEDIA_FOLDER;
+               mwindow->edl->assets->append(asset);
+               mwindow->awindow->gui->async_update_assets();
+       }
+       else {
+               eprintf("snapshot render failed");
+               asset->remove_user();
+       }
+       return 1;
+}
 
index f38a1a7e41fc3969016097ab899cfcf9f3138906..4b40006504c190f105a03e17c02f904df81d2e6c 100644 (file)
@@ -29,6 +29,9 @@
 #include "plugindialog.inc"
 #include "resizetrackthread.inc"
 
+#define SNAPSHOT_PNG  0
+#define SNAPSHOT_JPEG 1
+#define SNAPSHOT_TIFF 2
 
 class EditPopupResize;
 class EditPopupMatchSize;
@@ -36,6 +39,9 @@ class EditPopupTitleText;
 class EditPopupTitleWindow;
 class EditPopupTitleButton;
 class EditPopupTitleButtonRes;
+class EditSnapshot;
+class SnapshotSubMenu;
+class SnapshotMenuItem;
 
 class EditPopup : public BC_PopupMenu
 {
@@ -177,5 +183,34 @@ public:
 };
 
 
+class EditSnapshot : public BC_MenuItem
+{
+public:
+       EditSnapshot(MWindow *mwindow, EditPopup *popup);
+       ~EditSnapshot();
+
+       MWindow *mwindow;
+       EditPopup *popup;
+};
+
+class SnapshotSubMenu : public BC_SubMenu
+{
+public:
+       SnapshotSubMenu(EditSnapshot *edit_snapshot);
+       ~SnapshotSubMenu();
+
+       EditSnapshot *edit_snapshot;
+};
+
+class SnapshotMenuItem : public BC_MenuItem
+{
+public:
+       SnapshotMenuItem(SnapshotSubMenu *submenu, const char *text, int mode);
+       ~SnapshotMenuItem();
+
+       int handle_event();
+       SnapshotSubMenu *submenu;
+       int mode;
+};
 
 #endif
index e1d69537e766c2569ea64f509db5c4e81d89e720..ba27ce4ec648e34973603f598b6ab765e7030d4b 100644 (file)
@@ -86,6 +86,11 @@ void InterfacePrefs::create_objects()
        add_subwindow(keyframe_reticle);
        keyframe_reticle->create_objects();
 
+       y += 30;
+       add_subwindow(title = new BC_Title(x, y, _("Snapshot path:")));
+       y += title->get_h() + 5;
+       add_subwindow(snapshot_path = new SnapshotPathText(pwindow, this, x, y, get_w()-x-30));
+
        x = x0;  y = y2;
        add_subwindow(new BC_Title(x, y, _("Clicking on edit boundaries does what:")));
        y += 25;
@@ -604,3 +609,22 @@ int PrefsYUV420P_DVDlace::handle_event()
        return 1;
 }
 
+
+SnapshotPathText::SnapshotPathText(PreferencesWindow *pwindow,
+       InterfacePrefs *subwindow, int x, int y, int w)
+ : BC_TextBox(x, y, w, 1, pwindow->thread->preferences->snapshot_path)
+{
+       this->pwindow = pwindow;
+       this->subwindow = subwindow;
+}
+
+SnapshotPathText::~SnapshotPathText()
+{
+}
+
+int SnapshotPathText::handle_event()
+{
+       strcpy(pwindow->thread->preferences->snapshot_path, get_text());
+       return 1;
+}
+
index d4efc81f6ab5105d36b3b4b30976de599467e516..de0029cc3dbf0e801e0868ab3704f264a56fb662 100644 (file)
@@ -62,6 +62,7 @@ public:
        PrefsFileProbes *file_probes;
        PrefsTrapSigSEGV *trap_segv;
        PrefsTrapSigINTR *trap_intr;
+       SnapshotPathText *snapshot_path;
 };
 
 
@@ -273,5 +274,16 @@ public:
        PreferencesWindow *pwindow;
 };
 
+class SnapshotPathText : public BC_TextBox
+{
+public:
+       SnapshotPathText(PreferencesWindow *pwindow,
+               InterfacePrefs *subwindow, int x, int y, int w);
+       ~SnapshotPathText();
+
+       int handle_event();
+       PreferencesWindow *pwindow;
+       InterfacePrefs *subwindow;
+};
 
 #endif
index 727b9601ebce2fb4d0b277e597481a9858907bac..7fe7f91e2ab520fa733a25e9addeef81c2c6738e 100644 (file)
@@ -44,5 +44,6 @@ class PrefsTrapSigSEGV;
 class PrefsTrapSigINTR;
 class PrefsFileProbes;
 class PrefsYUV420P_DVDlace;
+class SnapshotPathText;
 
 #endif
index ee7c5d180f5a0890ebcf4b295eac09bba9e60a0c..257a12ab1ef2896a41e2843b44c7652c619c5bf9 100644 (file)
@@ -69,6 +69,7 @@ Preferences::Preferences()
        trap_sigintr = 1;
        theme[0] = 0;
        plugin_icons[0] = 0;
+       strcpy(snapshot_path, "/tmp");
        use_renderfarm = 0;
        force_uniprocessor = 0;
        renderfarm_port = DEAMON_PORT;
@@ -177,6 +178,7 @@ void Preferences::copy_from(Preferences *that)
        keyframe_reticle = that->keyframe_reticle;
        strcpy(theme, that->theme);
        strcpy(plugin_icons, that->plugin_icons);
+       strcpy(snapshot_path, that->snapshot_path);
 
        use_tipwindow = that->use_tipwindow;
        scan_commercials = that->scan_commercials;
@@ -324,6 +326,8 @@ int Preferences::load_defaults(BC_Hash *defaults)
        strcpy(plugin_icons, DEFAULT_PICON);
        defaults->get("THEME", theme);
        defaults->get("PLUGIN_ICONS", plugin_icons);
+       strcpy(snapshot_path, "/tmp");
+       defaults->get("SNAPSHOT_PATH", snapshot_path);
 
        for(int i = 0; i < MAXCHANNELS; i++)
        {
@@ -472,7 +476,7 @@ int Preferences::save_defaults(BC_Hash *defaults)
        defaults->update("TRAP_SIGINTR", trap_sigintr);
        defaults->update("THEME", theme);
        defaults->update("PLUGIN_ICONS", plugin_icons);
-
+       defaults->update("SNAPSHOT_PATH", snapshot_path);
 
        for(int i = 0; i < MAXCHANNELS; i++)
        {
index ac0784b53404f884b2981c84138ce0472e82507c..c93187ea86f2a328c30205e5400ad0ceb7b03c0a 100644 (file)
@@ -95,6 +95,8 @@ public:
        char theme[BCTEXTLEN];
 // plugin icon set
        char plugin_icons[BCTEXTLEN];
+// snapshot directory path
+       char snapshot_path[BCTEXTLEN];
        double render_preroll;
        int brender_preroll;
        int force_uniprocessor;
index 0285fd39247d6b59c12564a701927322b021fe41..e85cb599d00915743081ba8eeab9fe3351c4401b 100644 (file)
@@ -324,9 +324,9 @@ BC_ListBox::BC_ListBox(int x, int y, int w, int h,
        popup_w = w;
        popup_h = h;
 
-       for( int i = 0; i < 3; i++ ) column_bg[i] = 0;
-       for( int i = 0; i < 4; i++ ) button_images[i] = 0;
-       for( int i = 0; i < 5; i++ ) toggle_images[i] = 0;
+       for( int i=0; i<3; ++i ) column_bg[i] = 0;
+       for( int i=0; i<4; ++i ) button_images[i] = 0;
+       for( int i=0; i<5; ++i ) toggle_images[i] = 0;
 
        column_sort_up = 0;
        column_sort_dn = 0;
@@ -376,9 +376,9 @@ BC_ListBox::~BC_ListBox()
        if( bg_pixmap ) delete bg_pixmap;
        if( xscrollbar ) delete xscrollbar;
        if( yscrollbar ) delete yscrollbar;
-       for( int i = 0; i < 3; i++ ) delete column_bg[i];
-       for( int i = 0; i < 4; i++ ) delete button_images[i];
-       for( int i = 0; i < 5; i++ ) delete toggle_images[i];
+       for( int i=0; i<3; ++i ) delete column_bg[i];
+       for( int i=0; i<4; ++i ) delete button_images[i];
+       for( int i=0; i<5; ++i ) delete toggle_images[i];
        if( column_sort_up ) delete column_sort_up;
        if( column_sort_dn ) delete column_sort_dn;
 
@@ -407,7 +407,7 @@ void BC_ListBox::reset_query()
 
 int BC_ListBox::evaluate_query(char *string)
 {
-       for( int i = 0; i < data[search_column].size(); i++ ) {
+       for( int i=0; i<data[search_column].size(); ++i ) {
                if( strcmp(string, data[search_column].get(i)->text) <= 0 &&
                    data[search_column].get(i)->searchable ) {
                        return i;
@@ -430,8 +430,8 @@ int BC_ListBox::query_list()
 
        if( done ) {
 // Deselect all
-               for( int i = 0; i < data[0].total; i++ ) {
-                       for( int j = 0; j < columns; j++ ) {
+               for( int i=0; i<data[0].total; ++i ) {
+                       for( int j=0; j<columns; ++j ) {
                                if( data[j].values[i]->selected ) prev_selection = i;
                                data[j].values[i]->selected = 0;
                        }
@@ -440,7 +440,7 @@ int BC_ListBox::query_list()
 // Select one
                if( prev_selection != result )
                        selection_changed = 1;
-               for( int j = 0; j < columns; j++ ) {
+               for( int j=0; j<columns; ++j ) {
                        data[j].values[result]->selected = 1;
                }
                center_selection(result);
@@ -453,7 +453,7 @@ void BC_ListBox::init_column_width()
 {
        if( !column_width && data ) {
                int widest = 5, wd;
-               for( int i = 0; i < data[0].total; i++ ) {
+               for( int i=0; i<data[0].total; ++i ) {
                        wd = get_text_w(data[0].values[i]);
                        if( wd > widest ) widest = wd;
                }
@@ -465,7 +465,7 @@ int BC_ListBox::initialize()
 {
        if( is_popup ) {
                if( use_button ) {
-                       for( int i = 0; i < 4; ++i ) {
+                       for( int i=0; i<4; ++i ) {
                                button_images[i] = new BC_Pixmap(parent_window,
                                        BC_WindowBase::get_resources()->listbox_button[i],
                                        PIXMAP_ALPHA);
@@ -483,12 +483,12 @@ int BC_ListBox::initialize()
                current_operation = NO_OPERATION;
        }
 
-       for( int i = 0; i < 3; i++ ) {
+       for( int i=0; i<3; ++i ) {
                column_bg[i] = new BC_Pixmap(parent_window,
                        get_resources()->listbox_column[i],
                        PIXMAP_ALPHA);
        }
-       for( int i = 0; i < 5; i++ ) {
+       for( int i=0; i<5; ++i ) {
                toggle_images[i] = new BC_Pixmap(parent_window,
                        get_resources()->listbox_expand[i],
                        PIXMAP_ALPHA);
@@ -592,7 +592,7 @@ void BC_ListBox::calculate_last_coords_recursive(
        int *next_text_y,
        int top_level)
 {
-       for( int i = 0; i < data[0].size(); i++ ) {
+       for( int i=0; i<data[0].size(); ++i ) {
                int current_text_y = 0;
                int current_icon_x = 0;
                int current_icon_y = 0;
@@ -643,7 +643,7 @@ void BC_ListBox::calculate_item_coords_recursive(
 // get maximum height of an icon
        row_height = get_text_height(MEDIUMFONT);
        if( temp_display_format == LISTBOX_ICON_LIST ) {
-               for( int i = 0; i < data[0].size(); i++ ) {
+               for( int i=0; i<data[0].size(); ++i ) {
                        if( data[0].get(i)->icon ) {
                                if( data[0].get(i)->icon->get_h() > row_height )
                                        row_height = data[0].get(i)->icon->get_h();
@@ -654,7 +654,7 @@ void BC_ListBox::calculate_item_coords_recursive(
 
 // Set up items which need autoplacement.
 // Should fill icons down and then across
-       for( int i = 0; i < data[0].size(); i++ ) {
+       for( int i=0; i<data[0].size(); ++i ) {
 // Don't increase y unless the row requires autoplacing.
                int total_autoplaced_columns = 0;
 
@@ -687,7 +687,7 @@ void BC_ListBox::calculate_item_coords_recursive(
                int next_text_x = 0;
                row_ascent = row_descent = 0;
 // row_height still holds icon max height
-               for( int j = 0; j < columns; j++ ) {
+               for( int j=0; j<columns; ++j ) {
                        BC_ListBoxItem *item = data[j].get(i);
                        if( item->autoplace_text ) {
                                display_format = LISTBOX_TEXT;
@@ -911,8 +911,8 @@ int BC_ListBox::get_items_width()
        int widest = 0;
 
        if( display_format == LISTBOX_ICONS ) {
-               for( int i = 0; i < columns; i++ ) {
-                       for( int j = 0; j < data[i].total; j++ ) {
+               for( int i=0; i<columns; ++i ) {
+                       for( int j=0; j<data[i].total; ++j ) {
                                int x1, x, y, w, h;
                                BC_ListBoxItem *item = data[i].values[j];
                                x1 = item->icon_x;
@@ -949,7 +949,7 @@ int BC_ListBox::get_items_height(ArrayList<BC_ListBoxItem*> *data, int columns,
                top_level = 1;
        }
 
-       for( int j = 0; j < (data ? data[master_column].total : 0); j++ ) {
+       for( int j=0; j<(data?data[master_column].total:0); ++j ) {
                int x, y, w, h;
                BC_ListBoxItem *item = data[master_column].values[j];
 
@@ -1014,7 +1014,7 @@ void BC_ListBox::expand_item(BC_ListBoxItem *item, int expand)
 void BC_ListBox::collapse_recursive(ArrayList<BC_ListBoxItem*> *data,
                int master_column)
 {
-       for( int i = 0; i < data[master_column].total; i++ ) {
+       for( int i=0; i<data[master_column].total; ++i ) {
                BC_ListBoxItem *item = data[master_column].values[i];
                if( item->get_sublist() && item->expand ) {
                        item->expand = 0;
@@ -1027,8 +1027,8 @@ void BC_ListBox::set_autoplacement(ArrayList<BC_ListBoxItem*> *data,
        int do_icons,
        int do_text)
 {
-       for( int i = 0; i < data[0].total; i++ ) {
-               for( int j = 0; j < columns; j++ ) {
+       for( int i=0; i<data[0].total; ++i ) {
+               for( int j=0; j<columns; ++j ) {
                        if( do_icons ) data[j].values[i]->autoplace_icon = 1;
                        if( do_text ) data[j].values[i]->autoplace_text = 1;
                }
@@ -1101,13 +1101,13 @@ int BC_ListBox::get_column_offset(int column)
 void BC_ListBox::column_width_boundaries()
 {
        if( column_width ) {
-               for( int i = 0; i < columns; i++ ) {
+               for( int i=0; i<columns; ++i ) {
                        if( column_width[i] < MIN_COLUMN_WIDTH )
                                 column_width[i] = MIN_COLUMN_WIDTH;
                }
        }
        else {
-               for( int i = 0; i < columns; i++ ) {
+               for( int i=0; i<columns; ++i ) {
                        if( default_column_width[i] < MIN_COLUMN_WIDTH )
                                 default_column_width[i] = MIN_COLUMN_WIDTH;
                }
@@ -1212,7 +1212,7 @@ BC_ListBoxItem* BC_ListBox::get_selection_recursive(ArrayList<BC_ListBoxItem*> *
 {
        if( !data ) return 0;
 
-       for( int i = 0; i < data[master_column].total; i++ ) {
+       for( int i=0; i<data[master_column].total; ++i ) {
                BC_ListBoxItem *item = data[master_column].values[i];
                if( item->selected ) {
 //printf("BC_ListBox::get_selection_recursive %d\n", __LINE__);
@@ -1247,7 +1247,7 @@ int BC_ListBox::get_selection_number_recursive(ArrayList<BC_ListBoxItem*> *data,
        if( !data ) return 0;
        if( !counter ) counter = &temp;
 
-       for( int i = 0; i < data[master_column].total; i++ ) {
+       for( int i=0; i<data[master_column].total; ++i ) {
                (*counter)++;
                BC_ListBoxItem *item = data[master_column].values[i];
                if( item->selected ) {
@@ -1275,7 +1275,7 @@ int BC_ListBox::set_selection_mode(int mode)
 void BC_ListBox::delete_columns()
 {
        if( column_titles ) {
-               for( int i = 0; i < columns; i++ ) {
+               for( int i=0; i<columns; ++i ) {
                        delete [] column_titles[i];
                }
                delete [] column_titles;
@@ -1299,14 +1299,14 @@ void BC_ListBox::set_columns(const char **column_titles, int *column_width, int
        delete_columns();
        if( column_titles ) {
                this->column_titles = new char*[columns];
-               for( int i = 0; i < columns; i++ ) {
+               for( int i=0; i<columns; ++i ) {
                        this->column_titles[i] = new char[strlen(column_titles[i]) + 1];
                        strcpy(this->column_titles[i], column_titles[i]);
                }
        }
        if( column_width ) {
                this->column_width = new int[columns];
-               for( int i = 0; i < columns; i++ ) {
+               for( int i=0; i<columns; ++i ) {
                        this->column_width[i] = column_width[i];
                }
        }
@@ -1385,7 +1385,7 @@ int BC_ListBox::select_previous(int skip, BC_ListBoxItem *selected_item, int *co
 // Scan backwards to item pointer.  Then count visible items to get
 // destination.  No wraparound.
        do {
-               for( int i = data[master_column].total - 1; i >= 0; i-- ) {
+               for( int i=data[master_column].total-1; i>=0; --i ) {
                        BC_ListBoxItem *current_item = data[master_column].values[i];
                        if( current_item->get_sublist() &&
                            current_item->get_expand() ) {
@@ -1398,7 +1398,7 @@ int BC_ListBox::select_previous(int skip, BC_ListBoxItem *selected_item, int *co
                        if( *got_first ) {
                                (*counter)++;
                                if( (*counter) >= skip ) {
-                                       for( int j = 0; j < columns; j++ )
+                                       for( int j=0; j<columns; ++j )
                                                data[j].values[i]->selected = 1;
                                        (*got_second) = 1;
                                        return item_to_index(this->data, current_item);
@@ -1406,7 +1406,7 @@ int BC_ListBox::select_previous(int skip, BC_ListBoxItem *selected_item, int *co
                        }
                        else {
                                if( current_item->selected ) {
-                                       for( int j = 0; j < columns; j++ )
+                                       for( int j=0; j<columns; ++j )
                                                data[j].values[i]->selected = 0;
                                        (*got_first) = 1;
                                        (*counter)++;
@@ -1421,7 +1421,7 @@ int BC_ListBox::select_previous(int skip, BC_ListBoxItem *selected_item, int *co
                        (*got_first) = 1;
                        current_item = data[master_column].values[0];
 
-                       for( int j = 0; j < columns; j++ )
+                       for( int j=0; j<columns; ++j )
                                data[j].values[0]->selected = 1;
                        (*got_second) = 1;
                        return item_to_index(this->data, current_item);
@@ -1454,7 +1454,7 @@ int BC_ListBox::select_next(int skip, BC_ListBoxItem *selected_item, int *counte
 // Scan forwards to currently selected item pointer.
 // Then count visible items to get destination.  No wraparound.
        do {
-               for( int i = 0; i < data[master_column].total; i++ ) {
+               for( int i=0; i<data[master_column].total; ++i ) {
                        BC_ListBoxItem *current_item = data[master_column].values[i];
 
 // Select next item once the number items after the currently selected item
@@ -1462,7 +1462,7 @@ int BC_ListBox::select_next(int skip, BC_ListBoxItem *selected_item, int *counte
                        if( *got_first ) {
                                (*counter)++;
                                if( (*counter) >= skip ) {
-                                       for( int j = 0; j < columns; j++ )
+                                       for( int j=0; j<columns; ++j )
                                                data[j].values[i]->selected = 1;
                                        (*got_second) = 1;
                                        return item_to_index(this->data, current_item);
@@ -1471,7 +1471,7 @@ int BC_ListBox::select_next(int skip, BC_ListBoxItem *selected_item, int *counte
                        else {
 // Got currently selected item.  Deselect it.
                                if( current_item->selected ) {
-                                       for( int j = 0; j < columns; j++ )
+                                       for( int j=0; j<columns; ++j )
                                                data[j].values[i]->selected = 0;
                                        (*got_first) = 1;
                                        (*counter)++;
@@ -1497,7 +1497,7 @@ int BC_ListBox::select_next(int skip, BC_ListBoxItem *selected_item, int *counte
                                (*got_first) = 1;
                                current_item = data[master_column].values[0];
 
-                               for( int j = 0; j < columns; j++ )
+                               for( int j=0; j<columns; ++j )
                                        data[j].values[0]->selected = 1;
                                (*got_second) = 1;
                        }
@@ -1507,7 +1507,7 @@ int BC_ListBox::select_next(int skip, BC_ListBoxItem *selected_item, int *counte
                                int current_row = data[master_column].total - 1;
                                current_item = data[master_column].values[current_row];
 
-                               for( int j = 0; j < columns; j++ )
+                               for( int j=0; j<columns; ++j )
                                        data[j].values[current_row]->selected = 1;
                                (*got_second) = 1;
                        }
@@ -1551,7 +1551,7 @@ int BC_ListBox::center_selection(int selection,
        if( !data ) data = this->data;
        if( !counter ) counter = &temp;
 
-       for( int i = 0; i < data[master_column].total; i++ ) {
+       for( int i=0; i<data[master_column].total; ++i ) {
                (*counter)++;
 
 // Got it
@@ -1634,7 +1634,7 @@ int BC_ListBox::get_scrollbars()
        view_w = popup_w - 4;
 
 // Create scrollbars as needed
-       for( int i = 0; i < 2; i++ ) {
+       for( int i=0; i<2; ++i ) {
                if( w_needed > view_w ) {
                        need_xscroll = 1;
                        view_h = popup_h -
@@ -1823,8 +1823,8 @@ int BC_ListBox::select_rectangle(ArrayList<BC_ListBoxItem*> *data,
                int x1, int y1, int x2, int y2)
 {
        int result = 0;
-       for( int i = 0; i < data[master_column].total; i++ ) {
-               for( int j = 0; j < columns; j++ ) {
+       for( int i=0; i<data[master_column].total; ++i ) {
+               for( int j=0; j<columns; ++j ) {
                        BC_ListBoxItem *item = data[j].values[i];
                        if( display_format == LISTBOX_ICONS ) {
                                int icon_x, icon_y, icon_w, icon_h;
@@ -1884,7 +1884,7 @@ int BC_ListBox::reposition_item(ArrayList<BC_ListBoxItem*> *data,
        int temp = -1;
        if( !counter ) counter = &temp;
 
-       for( int i = 0; i < data[master_column].total; i++ ) {
+       for( int i=0; i<data[master_column].total; ++i ) {
                BC_ListBoxItem *item = data[master_column].values[i];
                (*counter)++;
                if( (*counter) == selection_number ) {
@@ -1900,12 +1900,12 @@ int BC_ListBox::reposition_item(ArrayList<BC_ListBoxItem*> *data,
 void BC_ListBox::move_selection(ArrayList<BC_ListBoxItem*> *dst,
        ArrayList<BC_ListBoxItem*> *src)
 {
-       for( int i = 0; i < src[master_column].total;  ) {
+       for( int i=0; i<src[master_column].total;  ) {
                BC_ListBoxItem *item = src[master_column].values[i];
 
 // Move item to dst
                if( item->selected ) {
-                       for( int j = 0; j < columns; j++ ) {
+                       for( int j=0; j<columns; ++j ) {
                                dst[j].append(src[j].values[i]);
                                src[j].remove_number(i);
                        }
@@ -1927,19 +1927,19 @@ int BC_ListBox::put_selection(ArrayList<BC_ListBoxItem*> *data,
        if( !counter ) counter = &temp;
 
        if( destination < 0 || destination >= data[master_column].total ) {
-               for( int j = 0; j < columns; j++ ) {
-                       for( int i = 0; i < src[j].total; i++ ) {
+               for( int j=0; j<columns; ++j ) {
+                       for( int i=0; i<src[j].total; ++i ) {
                                data[j].append(src[j].values[i]);
                        }
                }
                return 1;
        }
        else
-       for( int i = 0; i < data[master_column].total; i++ ) {
+       for( int i=0; i<data[master_column].total; ++i ) {
                (*counter)++;
                if( (*counter) == destination ) {
-                       for( int j = 0; j < columns; j++ ) {
-                               for( int k = 0; k < src[j].total; k++ ) {
+                       for( int j=0; j<columns; ++j ) {
+                               for( int k=0; k<src[j].total; ++k ) {
                                        data[j].insert(src[j].values[k], destination + k);
                                }
                        }
@@ -1966,9 +1966,9 @@ int BC_ListBox::item_to_index(ArrayList<BC_ListBoxItem*> *data,
        int temp = -1;
        if( !counter ) counter = &temp;
 
-       for( int i = 0; i < data[master_column].total; i++ ) {
+       for( int i=0; i<data[master_column].total; ++i ) {
                (*counter)++;
-               for( int j = 0; j < columns; j++ ) {
+               for( int j=0; j<columns; ++j ) {
                        BC_ListBoxItem *new_item = data[j].values[i];
 //printf("BC_ListBox::item_to_index 1 %d %d %p\n", j, i, new_item);
                        if( new_item == item ) {
@@ -1993,7 +1993,7 @@ BC_ListBoxItem* BC_ListBox::index_to_item(ArrayList<BC_ListBoxItem*> *data,
 {
        int temp = -1;
        if( !counter ) counter = &temp;
-       for( int i = 0; i < data[master_column].total; i++ ) {
+       for( int i=0; i<data[master_column].total; ++i ) {
                (*counter)++;
                if( (*counter) == number ) {
                        return data[column].values[i];
@@ -2017,7 +2017,7 @@ int BC_ListBox::get_cursor_item(ArrayList<BC_ListBoxItem*> *data, int cursor_x,
 
 // Icons are not treed
        if( display_format == LISTBOX_ICONS ) {
-               for( int j = data[master_column].total - 1; j >= 0; j-- ) {
+               for( int j=data[master_column].total-1; j>=0; --j ) {
                        int icon_x, icon_y, icon_w, icon_h;
                        int text_x, text_y, text_w, text_h;
                        BC_ListBoxItem *item = data[master_column].values[j];
@@ -2045,7 +2045,7 @@ int BC_ListBox::get_cursor_item(ArrayList<BC_ListBoxItem*> *data, int cursor_x,
                        (cursor_y > get_title_h() + LISTBOX_BORDER &&
                         cursor_y < gui->get_h())) ) {
 // Search table for cursor obstruction
-                       for( int i = 0; i < data[master_column].total; i++ ) {
+                       for( int i=0; i<data[master_column].total; ++i ) {
                                BC_ListBoxItem *item = data[master_column].values[i];
                                (*counter)++;
 
@@ -2156,7 +2156,7 @@ int BC_ListBox::cursor_leave_event()
                highlighted_ptr = 0;
                highlighted_title = -1;
                int redraw_toggles = 0;
-               for( int i = 0; i < expanders.total; i++ )
+               for( int i=0; i<expanders.total; ++i )
                        expanders.values[i]->cursor_leave_event(&redraw_toggles);
 
                draw_items(1);
@@ -2170,7 +2170,7 @@ int BC_ListBox::get_first_selection(ArrayList<BC_ListBoxItem*> *data, int *resul
        int temp = -1;
        if( !result ) result = &temp;
 
-       for( int i = 0; i < data[master_column].total; i++ ) {
+       for( int i=0; i<data[master_column].total; ++i ) {
                BC_ListBoxItem *item = data[master_column].values[i];
                (*result)++;
                if( item->selected ) return (*result);
@@ -2189,7 +2189,7 @@ int BC_ListBox::get_total_items(ArrayList<BC_ListBoxItem*> *data,
        int temp = 0;
        if( !result ) result = &temp;
 
-       for( int i = 0; i < data[master_column].total; i++ ) {
+       for( int i=0; i<data[master_column].total; ++i ) {
                (*result)++;
                if( data[master_column].values[i]->get_sublist() )
                        get_total_items(data[master_column].values[i]->get_sublist(),
@@ -2211,7 +2211,7 @@ int BC_ListBox::get_last_selection(ArrayList<BC_ListBoxItem*> *data,
                top_level = 1;
        }
 
-       for( int i = data[master_column].total - 1; i >= 0; i-- ) {
+       for( int i=data[master_column].total-1; i>=0; --i ) {
                BC_ListBoxItem *item = data[master_column].values[i];
                (*result)++;
                if( item->selected ) {
@@ -2239,10 +2239,10 @@ void BC_ListBox::select_range(ArrayList<BC_ListBoxItem*> *data,
        int temp = -1;
        if( !current ) current = &temp;
 
-       for( int i = 0; i < data[master_column].total; i++ ) {
+       for( int i=0; i<data[master_column].total; ++i ) {
                (*current)++;
                if( (*current) >= start && (*current) < end ) {
-                       for( int j = 0; j < columns; j++ )
+                       for( int j=0; j<columns; ++j )
                                data[j].values[i]->selected = 1;
                }
                BC_ListBoxItem *item = data[master_column].values[i];
@@ -2285,14 +2285,14 @@ int BC_ListBox::toggle_item_selection(ArrayList<BC_ListBoxItem*> *data,
        int temp = -1;
        if( !counter ) counter = &temp;
 
-       for( int i = 0; i < data[master_column].total; i++ ) {
+       for( int i=0; i<data[master_column].total; ++i ) {
                BC_ListBoxItem *item = data[master_column].values[i];
                (*counter)++;
                if( (*counter) == selection_number ) {
 // Get new value for selection
                        int selected = !item->selected;
 // Set row
-                       for( int j = 0; j < columns; j++ )
+                       for( int j=0; j<columns; ++j )
                                data[j].values[i]->selected = selected;
                        return 1;
                }
@@ -2311,8 +2311,8 @@ int BC_ListBox::toggle_item_selection(ArrayList<BC_ListBoxItem*> *data,
 
 void BC_ListBox::set_all_selected(ArrayList<BC_ListBoxItem*> *data, int value)
 {
-       for( int i = 0; i < data[master_column].total; i++ ) {
-               for( int j = 0; j < columns; j++ ) {
+       for( int i=0; i<data[master_column].total; ++i ) {
+               for( int j=0; j<columns; ++j ) {
                        BC_ListBoxItem *item = data[j].values[i];
                        item->selected = value;
                }
@@ -2328,10 +2328,10 @@ void BC_ListBox::set_selected(ArrayList<BC_ListBoxItem*> *data,
 {
        int temp = -1;
        if( !counter ) counter = &temp;
-       for( int i = 0; i < data[master_column].total && (*counter) != item_number; i++ ) {
+       for( int i=0; i<data[master_column].total&&(*counter)!=item_number; ++i ) {
                (*counter)++;
                if( (*counter) == item_number ) {
-                       for( int j = 0; j < columns; j++ ) {
+                       for( int j=0; j<columns; ++j ) {
                                BC_ListBoxItem *item = data[j].values[i];
                                item->selected = value;
                        }
@@ -2352,18 +2352,18 @@ int BC_ListBox::update_selection(ArrayList<BC_ListBoxItem*> *data,
        int result = 0;
        if( !counter ) counter = &temp;
 
-       for( int i = 0; i < data[master_column].total; i++ ) {
+       for( int i=0; i<data[master_column].total; ++i ) {
                BC_ListBoxItem *item = data[master_column].values[i];
                (*counter)++;
                if( (*counter) == selection_number && !item->selected ) {
                        result = 1;
-                       for( int j = 0; j < columns; j++ )
+                       for( int j=0; j<columns; ++j )
                                data[j].values[i]->selected = 1;
                }
                else
                if( (*counter) != selection_number && item->selected ) {
                        result = 1;
-                       for( int j = 0; j < columns; j++ )
+                       for( int j=0; j<columns; ++j )
                                data[j].values[i]->selected = 0;
                }
                if( item->get_sublist() )
@@ -2377,8 +2377,8 @@ int BC_ListBox::update_selection(ArrayList<BC_ListBoxItem*> *data,
 void BC_ListBox::promote_selections(ArrayList<BC_ListBoxItem*> *data,
                int old_value, int new_value)
 {
-       for( int i = 0; i < data[master_column].total; i++ ) {
-               for( int j = 0; j < columns; j++ ) {
+       for( int i=0; i<data[master_column].total; ++i ) {
+               for( int j=0; j<columns; ++j ) {
                        BC_ListBoxItem *item = data[j].values[i];
                        if( item->selected == old_value ) item->selected = new_value;
                }
@@ -2730,7 +2730,7 @@ int BC_ListBox::button_release_event()
 
        case EXPAND_DN: {
                int redraw_toggles = 0;
-               for( int i = 0; i < expanders.total && !result; i++ ) {
+               for( int i=0; i<expanders.total&&!result; ++i ) {
                        if( expanders.values[i]->button_release_event(&redraw_toggles) ) {
                                result = 1;
                        }
@@ -2778,7 +2778,7 @@ int BC_ListBox::test_column_divisions(int cursor_x, int cursor_y, int &new_curso
        if( gui && column_titles &&
            cursor_y >= 0 && cursor_y < get_title_h() &&
            cursor_x >= 0 && cursor_x < gui->get_w() ) {
-               for( int i = 1; i < columns; i++ ) {
+               for( int i=1; i<columns; ++i ) {
                        if( cursor_x >= -xposition + get_column_offset(i) - 5 &&
                            cursor_x <  -xposition + get_column_offset(i) +
                                        get_resources()->listbox_title_hotspot ) {
@@ -2801,7 +2801,7 @@ int BC_ListBox::test_column_titles(int cursor_x, int cursor_y)
        if( gui && column_titles &&
            cursor_y >= 0 && cursor_y < get_title_h() &&
            cursor_x >= 0 && cursor_x < gui->get_w() ) {
-               for( int i = 0; i < columns; i++ ) {
+               for( int i=0; i<columns; ++i ) {
                        if( cursor_x >= -xposition + get_column_offset(i) &&
                                (cursor_x < -xposition + get_column_offset(i + 1) ||
                                        i == columns - 1) ) {
@@ -2820,7 +2820,7 @@ int BC_ListBox::test_column_titles(int cursor_x, int cursor_y)
 
 int BC_ListBox::test_expanders()
 {
-       for( int i = 0; i < expanders.total; i++ ) {
+       for( int i=0; i<expanders.total; ++i ) {
                if( expanders.values[i]->button_press_event() ) {
                        current_operation = EXPAND_DN;
                        draw_toggles(1);
@@ -3006,7 +3006,7 @@ int BC_ListBox::cursor_motion_event()
 
        case EXPAND_DN: {
                int redraw_toggles = 0;
-               for( int i = 0; i < expanders.total && !result; i++ ) {
+               for( int i=0; i<expanders.total&&!result; ++i ) {
                        result = expanders.values[i]->cursor_motion_event(
                                &redraw_toggles);
                }
@@ -3040,7 +3040,7 @@ int BC_ListBox::cursor_motion_event()
                        if( highlighted_division < 0 && highlighted_title < 0 &&
                            (display_format == LISTBOX_TEXT ||
                             display_format == LISTBOX_ICON_LIST) ) {
-                               for( int i = 0; i < expanders.total; i++ ) {
+                               for( int i=0; i<expanders.total; ++i ) {
                                        expanders.values[i]->cursor_motion_event(
                                                &redraw_toggles);
                                }
@@ -3590,7 +3590,7 @@ int BC_ListBox::draw_items(int flush, int draw_bg)
                        clear_listbox(2, 2 + title_h, view_w, view_h);
 
                        set_font(MEDIUMFONT);
-                       for( int i = 0; i < data[master_column].size(); i++ ) {
+                       for( int i=0; i<data[master_column].size(); ++i ) {
                                BC_ListBoxItem *item = data[master_column].get(i);
                                if( get_item_x(item) >= -get_item_w(item) &&
                                    get_item_x(item) < view_w &&
@@ -3646,7 +3646,7 @@ int BC_ListBox::draw_items(int flush, int draw_bg)
 // Draw one column at a time so text overruns don't go into the next column
 // clear column backgrounds
                        int current_toggle = 0;
-                       for( int j = 0; j < columns; j++ ) {
+                       for( int j=0; j<columns; ++j ) {
                                clear_listbox(LISTBOX_BORDER + get_column_offset(j) - xposition,
                                        LISTBOX_BORDER + title_h,
                                        get_column_width(j, 1),
@@ -3700,7 +3700,7 @@ void BC_ListBox::draw_text_recursive(ArrayList<BC_ListBoxItem*> *data,
 
 // Search for a branch and make room for toggle if there is one
        if( column == 0 ) {
-               for( int i = 0; i < data[column].size(); i++ ) {
+               for( int i=0; i<data[column].size(); ++i ) {
                        if( data[column].get(i)->get_sublist() ) {
                                subindent = BC_WindowBase::get_resources()->listbox_expand[0]->get_w();
                                break;
@@ -3709,7 +3709,7 @@ void BC_ListBox::draw_text_recursive(ArrayList<BC_ListBoxItem*> *data,
        }
 
        row_height = row_ascent = row_descent = 0;
-       for( int i = 0; i < data[column].total; i++ ) {
+       for( int i=0; i<data[column].total; ++i ) {
                BC_ListBoxItem *item = data[column].values[i];
                int ht = get_text_h(item);
                if( ht > row_height ) row_height = ht;
@@ -3719,7 +3719,7 @@ void BC_ListBox::draw_text_recursive(ArrayList<BC_ListBoxItem*> *data,
                if( dt > row_descent ) row_ascent = bl;
        }
 
-       for( int i = 0; i < data[column].size(); i++ ) {
+       for( int i=0; i<data[column].size(); ++i ) {
 // Draw a row
                BC_ListBoxItem *item = data[column].values[i];
                BC_ListBoxItem *first_item = data[master_column].values[i];
@@ -3877,7 +3877,7 @@ int BC_ListBox::draw_titles(int flash)
            (display_format == LISTBOX_TEXT ||
             display_format == LISTBOX_ICON_LIST) ) {
 //printf("BC_ListBox::draw_titles 1 %d\n", highlighted_title);
-               for( int i = 0; i < columns; i++ ) {
+               for( int i=0; i<columns; ++i ) {
                        if( i != highlighted_title )
                                draw_title(i);
                }
@@ -3894,7 +3894,7 @@ int BC_ListBox::draw_titles(int flash)
 
 void BC_ListBox::draw_toggles(int flash)
 {
-       for( int i = 0; i < expanders.total; i++ )
+       for( int i=0; i<expanders.total; ++i )
                expanders.values[i]->draw(0);
 
 //printf("BC_ListBox::draw_toggles 1 %d\n", flash);
@@ -3931,10 +3931,10 @@ void BC_ListBox::dump(ArrayList<BC_ListBoxItem*> *data, int columns,
                printf("BC_ListBox::dump 1\n");
        }
 
-       for( int i = 0; i < data[master_column].total; i++ ) {
-               for( int k = 0; k < indent; k++ )
+       for( int i=0; i<data[master_column].total; ++i ) {
+               for( int k=0; k<indent; ++k )
                        printf(" ");
-               for( int j = 0; j < columns; j++ ) {
+               for( int j=0; j<columns; ++j ) {
                        BC_ListBoxItem *item = data[j].values[i];
                        printf("%d,%d,%d=%s ",
                                item->get_text_x(), item->get_text_y(),
index 2ab104e094b78244b1c586b7c6a1de38a8c1eff0..521b7740bc087a2560c497b69f25bc07e3cbcd30 100644 (file)
@@ -200,22 +200,34 @@ suffix_to_type_t BC_Resources::suffix_to_type[] =
     { "aac", ICON_SOUND },
     { "ac3", ICON_SOUND },
     { "dts", ICON_SOUND },
+    { "f4a", ICON_SOUND },
     { "flac", ICON_SOUND },
+    { "m4a", ICON_SOUND },
     { "mp2", ICON_SOUND },
     { "mp3", ICON_SOUND },
+    { "mpc", ICON_SOUND },
+    { "oga", ICON_SOUND },
+    { "ogg", ICON_SOUND },
+    { "opus", ICON_SOUND },
+    { "ra", ICON_SOUND },
+    { "tta", ICON_SOUND },
+    { "vox", ICON_SOUND },
     { "wav", ICON_SOUND },
     { "wma", ICON_SOUND },
-    { "wmv", ICON_SOUND },
+    { "3gp", ICON_FILM },
     { "avi", ICON_FILM },
     { "bmp", ICON_FILM },
     { "cr2", ICON_FILM },
     { "dnxhd", ICON_FILM },
-    { "dvd", ICON_FILM },
+    { "drc", ICON_FILM },
     { "dv", ICON_FILM },
+    { "dvd", ICON_FILM },
+    { "exr", ICON_FILM },
     { "f4v", ICON_FILM },
     { "flv", ICON_FILM },
     { "gif", ICON_FILM },
     { "gxf", ICON_FILM },
+    { "h263", ICON_FILM },
     { "h264", ICON_FILM },
     { "h265", ICON_FILM },
     { "hevc", ICON_FILM },
@@ -225,15 +237,18 @@ suffix_to_type_t BC_Resources::suffix_to_type[] =
     { "m2t", ICON_FILM },
     { "m2ts", ICON_FILM },
     { "m2v", ICON_FILM },
+    { "m4p", ICON_FILM },
     { "m4v", ICON_FILM },
     { "mkv", ICON_FILM },
     { "mov", ICON_FILM },
     { "mp4", ICON_FILM },
+    { "m4p", ICON_FILM },
+    { "mpe", ICON_FILM },
     { "mpeg", ICON_FILM },
     { "mpg", ICON_FILM },
+    { "mpv", ICON_FILM },
     { "mts", ICON_FILM },
     { "mxf", ICON_FILM },
-    { "ogg", ICON_FILM },
     { "ogv", ICON_FILM },
     { "pcm", ICON_FILM },
     { "pgm", ICON_FILM },
@@ -241,14 +256,17 @@ suffix_to_type_t BC_Resources::suffix_to_type[] =
     { "ppm", ICON_FILM },
     { "qt", ICON_FILM },
     { "rm", ICON_FILM },
+    { "rmvb", ICON_FILM },
+    { "rv", ICON_FILM },
     { "swf", ICON_FILM },
-    { "tiff", ICON_FILM },
     { "tif", ICON_FILM },
+    { "tiff", ICON_FILM },
     { "ts",  ICON_FILM },
     { "vob", ICON_FILM },
     { "vts", ICON_FILM },
     { "webm", ICON_FILM },
     { "webp", ICON_FILM },
+    { "wmv", ICON_FILM },
     { "xml", ICON_FILM },
     { "y4m", ICON_FILM },
     { 0, 0 },