improve delays created by vicon drawing locks, reset_cache segv fix, gang track toolt...
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / awindowgui.h
index d135145555cd4bb8552cea543ff19d37d20ea4ea..aa182f9ecf57eb1c6aef9206ba8b400bc3be16ad 100644 (file)
@@ -35,6 +35,7 @@
 #include "edl.inc"
 #include "effectlist.inc"
 #include "folderlistmenu.inc"
 #include "edl.inc"
 #include "effectlist.inc"
 #include "folderlistmenu.inc"
+#include "garbage.h"
 #include "guicast.h"
 #include "labeledit.inc"
 #include "labelpopup.inc"
 #include "guicast.h"
 #include "labeledit.inc"
 #include "labelpopup.inc"
 #include "mwindow.inc"
 #include "mutex.inc"
 #include "pluginserver.inc"
 #include "mwindow.inc"
 #include "mutex.inc"
 #include "pluginserver.inc"
+#include "preferences.inc"
 #include "proxypopup.inc"
 #include "renderengine.inc"
 #include "samples.inc"
 #include "vicon.h"
 
 #include "proxypopup.inc"
 #include "renderengine.inc"
 #include "samples.inc"
 #include "vicon.h"
 
+#define SELECT_ALL 0
+#define SELECT_USED 1
+#define SELECT_UNUSED 2
+#define SELECT_NONE 3
+
+// in percent view_h
+#define VIEW_POPUP_BAR_H 15
+
+#define ASSET_VIEW_NONE 0
+#define ASSET_VIEW_ICON 1
+#define ASSET_VIEW_MEDIA 2
+#define ASSET_VIEW_MEDIA_MAP 3
+#define ASSET_VIEW_FULL 4
+
+#define AVICON_FULL_PLAY   0
+#define AVICON_MOUSE_OVER  1
+#define AVICON_SRC_TARGET  2
+#define AVICON_NO_PLAY     3
+#define AVICON_PLAY_MODES  4
+
 class AWindowFolderItem : public BC_ListBoxItem
 {
 public:
 class AWindowFolderItem : public BC_ListBoxItem
 {
 public:
@@ -76,7 +98,12 @@ public:
        void reset();
        static void draw_hue_bar(VFrame *frame, double t);
        static void draw_wave(VFrame *frame, double *dp, int len,
        void reset();
        static void draw_hue_bar(VFrame *frame, double t);
        static void draw_wave(VFrame *frame, double *dp, int len,
-               int base_color, int line_color);
+               int base_color, int line_color, int x, int y, int w, int h);
+       static void draw_wave(VFrame *frame, double *dp, int len,
+               int base_color, int line_color, int x=0, int y=0) {
+         draw_wave(frame, dp, len, base_color, line_color,
+               x,y,frame->get_w(),frame->get_h());
+       }
        void open_render_engine(EDL *edl, int is_audio);
        void close_render_engine();
        void render_video(int64_t pos, VFrame *vfrm);
        void open_render_engine(EDL *edl, int is_audio);
        void close_render_engine();
        void render_video(int64_t pos, VFrame *vfrm);
@@ -104,10 +131,13 @@ public:
        int in_use;
        int persistent;
        time_t comments_time;
        int in_use;
        int persistent;
        time_t comments_time;
+       int comments_ffmt;
+       double comments_rate;
+       const char *comments_type;
        double sort_key;
        PluginServer *plugin;
        Label *label;
        double sort_key;
        PluginServer *plugin;
        Label *label;
-       VIcon *vicon;
+       AssetVIcon *vicon;
        RenderEngine *render_engine;
 };
 
        RenderEngine *render_engine;
 };
 
@@ -130,11 +160,12 @@ public:
        int audio_pos;
 };
 
        int audio_pos;
 };
 
-class AssetVIcon : public VIcon {
+class AssetVIcon : public VIcon, public Garbage {
 public:
        AssetPicon *picon;
        VFrame *temp;
        int64_t length;
 public:
        AssetPicon *picon;
        VFrame *temp;
        int64_t length;
+       int broken;
 
        VFrame *frame();
        int64_t set_seq_no(int64_t no);
 
        VFrame *frame();
        int64_t set_seq_no(int64_t no);
@@ -148,6 +179,46 @@ public:
        ~AssetVIcon();
 };
 
        ~AssetVIcon();
 };
 
+class AssetViewPopup : public ViewPopup
+{
+public:
+       AssetViewPopup(VIconThread *vt, int draw_mode,
+                       int x, int y, int w, int h);
+       ~AssetViewPopup();
+
+       int reposition_window(int x, int y, int w, int h);
+       int button_press_event();
+       int button_release_event();
+       int cursor_motion_event();
+       int keypress_event();
+
+       void draw_vframe(VFrame *frame);
+
+       int bar_h;
+       int draw_mode;
+       int dragging;
+};
+
+class AssetVIconThread : public VIconThread
+{
+public:
+       AssetVIconThread(AWindowGUI *gui, Preferences *preferences);
+       ~AssetVIconThread();
+
+       void set_view_popup(AssetVIcon *v, int draw_mode);
+       void set_view_popup(AssetVIcon *v);
+       ViewPopup *new_view_window(ViewPopup *popup);
+       void stop_vicon_drawing(int wait=0);
+       void drawing_started();
+       void drawing_stopped();
+
+       AWindowGUI *gui;
+       int draw_mode;
+       int vicon_cmodel;
+       Mutex *draw_lock;
+};
+
+
 class AWindowRemovePlugin;
 
 class AWindowRemovePluginGUI : public BC_Window {
 class AWindowRemovePlugin;
 
 class AWindowRemovePluginGUI : public BC_Window {
@@ -200,7 +271,7 @@ public:
        int drag_stop();
 // Collect items into the drag vectors of MainSession
        void collect_assets(int proxy=0);
        int drag_stop();
 // Collect items into the drag vectors of MainSession
        void collect_assets(int proxy=0);
-       EDL *collect_proxy(Indexable *indexable);
+       EDL *collect_proxy(Asset *asset);
        void create_persistent_folder(ArrayList<BC_ListBoxItem*> *output,
                int do_audio,
                int do_video,
        void create_persistent_folder(ArrayList<BC_ListBoxItem*> *output,
                int do_audio,
                int do_video,
@@ -216,10 +287,11 @@ public:
        bool protected_pixmap(BC_Pixmap *pixmap);
        int save_defaults(BC_Hash *defaults);
        int load_defaults(BC_Hash *defaults);
        bool protected_pixmap(BC_Pixmap *pixmap);
        int save_defaults(BC_Hash *defaults);
        int load_defaults(BC_Hash *defaults);
-       void start_vicon_drawing();
-       void stop_vicon_drawing();
+       int start_vicon_drawing();
+       int stop_vicon_drawing(int wait=0);
        void update_picon(Indexable *indexable);
        int cycle_assetlist_format();
        void update_picon(Indexable *indexable);
        int cycle_assetlist_format();
+       void hide_tip_info();
 
        VFrame *get_picon(const char *name, const char *plugin_icons);
        VFrame *get_picon(const char *name);
 
        VFrame *get_picon(const char *name, const char *plugin_icons);
        VFrame *get_picon(const char *name);
@@ -293,15 +365,17 @@ public:
        AddTools *add_tools;
 // Temporary for reading picons from files
        VFrame *temp_picon;
        AddTools *add_tools;
 // Temporary for reading picons from files
        VFrame *temp_picon;
-       VIconThread *vicon_thread;
+       AssetVIconThread *vicon_thread;
        AssetVIconAudio *vicon_audio;
 
        int64_t plugin_visibility;
        AWindowRemovePlugin *remove_plugin;
 
        AVIconDrawing *avicon_drawing;
        AssetVIconAudio *vicon_audio;
 
        int64_t plugin_visibility;
        AWindowRemovePlugin *remove_plugin;
 
        AVIconDrawing *avicon_drawing;
-       int avicon_w, avicon_h, vicon_drawing;
+       int avicon_w, avicon_h;
+       int vicon_drawing, play_off;
        int allow_iconlisting;
        int allow_iconlisting;
+       int tip_info;
 
 // Create custom atoms to be used for async messages between windows
        int create_custom_xatoms();
 
 // Create custom atoms to be used for async messages between windows
        int create_custom_xatoms();
@@ -334,15 +408,17 @@ public:
        int drag_stop_event();
        int button_press_event();
        int column_resize_event();
        int drag_stop_event();
        int button_press_event();
        int column_resize_event();
-       int focus_in_event();
-       int focus_out_event();
        int cursor_enter_event();
        int cursor_leave_event();
        int cursor_enter_event();
        int cursor_leave_event();
+       int focus_out_event();
        void update_vicon_area();
        int mouse_over_event(int no);
        void update_vicon_area();
        int mouse_over_event(int no);
+       void show_tip_info(const char *info, int no);
+       void hide_tip_info();
 
        MWindow *mwindow;
        AWindowGUI *gui;
 
        MWindow *mwindow;
        AWindowGUI *gui;
+       int info_tip;
 };
 
 class AWindowDivider : public BC_SubWindow
 };
 
 class AWindowDivider : public BC_SubWindow
@@ -511,16 +587,28 @@ public:
        int idx;
 };
 
        int idx;
 };
 
-class AVIconDrawing : public BC_Toggle
+class AVIconDrawingItem : public BC_MenuItem
 {
 public:
 {
 public:
-       AWindowGUI *agui;
-
+       AVIconDrawingItem(AVIconDrawing *avicon, const char *text, int id);
        int handle_event();
        int handle_event();
-       static void calculate_geometry(AWindowGUI *agui, VFrame **images, int *ww, int *hh);
 
 
-       AVIconDrawing(AWindowGUI *agui, int x, int y, VFrame **images);
+       AVIconDrawing *avicon;
+       int id;
+};
+
+class AVIconDrawing : public BC_PopupMenu
+{
+public:
+       AVIconDrawing(AWindowGUI *agui, int x, int y, int w, const char *text);
        ~AVIconDrawing();
        ~AVIconDrawing();
+
+       static const char *avicon_names[];
+       void create_objects();
+       int button_press_event();
+       int draw_face(int dx, int color);
+
+       AWindowGUI *agui;
 };
 
 
 };
 
 
@@ -547,4 +635,23 @@ public:
        AWindowGUI *gui;
 };
 
        AWindowGUI *gui;
 };
 
+class AssetSelectUsedItem : public BC_MenuItem
+{
+public:
+       AssetSelectUsedItem(AssetSelectUsed *select_used, const char *text, int action);
+       int handle_event();
+
+       int action;
+       AssetSelectUsed *select_used;
+};
+
+class AssetSelectUsed : public BC_MenuItem
+{
+public:
+       AssetSelectUsed(MWindow *mwindow, AWindowGUI *gui);
+
+       MWindow *mwindow;
+       AWindowGUI *gui;
+};
+
 #endif
 #endif