rework android-rmt display, add a few buttons
[goodguy/history.git] / cinelerra-5.0 / cinelerra / assetedit.C
index 44d265a7147e19ab251406e4a0e792d010fcf256..5422d97eef2c77cc954b099022010a3f34746457 100644 (file)
@@ -68,6 +68,7 @@ AssetEdit::AssetEdit(MWindow *mwindow)
 
 AssetEdit::~AssetEdit()
 {
+       close_window();
        changed_params->remove_user();
 }
 
@@ -76,7 +77,7 @@ void AssetEdit::edit_asset(Indexable *indexable)
 {
        if(this->indexable)
        {
-               BC_DialogThread::close_window();
+               close_window();
        }
 
        this->indexable = indexable;
@@ -212,7 +213,7 @@ BC_Window* AssetEdit::new_gui()
 
 
 AssetEditWindow::AssetEditWindow(MWindow *mwindow, AssetEdit *asset_edit)
- : BC_Window(PROGRAM_NAME ": Asset Info"
+ : BC_Window(_(PROGRAM_NAME ": Asset Info")
        mwindow->gui->get_abs_cursor_x(1) - 400 / 2, 
        mwindow->gui->get_abs_cursor_y(1) - 500 / 2, 
        400, 
@@ -281,7 +282,7 @@ void AssetEditWindow::create_objects()
                path_text, 
                y, 
                asset_edit->indexable->path, 
-               PROGRAM_NAME ": Asset path", _("Select a file for this asset:")));
+               _(PROGRAM_NAME ": Asset path"), _("Select a file for this asset:")));
        y += 30;
 
        if(asset)
@@ -769,7 +770,7 @@ int DetailAssetButton::handle_event()
 }
 
 DetailAssetWindow::DetailAssetWindow(MWindow *mwindow, Asset *asset)
- : BC_Window("Asset Detail",
+ : BC_Window(_("Asset Detail"),
         mwindow->gui->get_abs_cursor_x(1) - 600/2,
         mwindow->gui->get_abs_cursor_y(1) - 500/2,
         600, 500)
@@ -795,9 +796,14 @@ DetailAssetThread::DetailAssetThread(MWindow *mwindow)
 }
 
 DetailAssetThread::~DetailAssetThread()
+{
+       stop();
+}
+
+void DetailAssetThread::stop()
 {
        if( Thread::running() ) {
-               dwindow->lock_window("DetailAssetThread::~DetailAssetThread");
+               dwindow->lock_window("DetailAssetThread::stop");
                dwindow->set_done(1);
                dwindow->unlock_window();
                Thread::join();
@@ -809,14 +815,14 @@ void DetailAssetWindow::create_objects()
        int y = 10, x = 10;
        char file_name[BCTEXTLEN];
        int len = sizeof(info);
-       strncpy(info,"no info available",len);
+       strncpy(info,_("no info available"),len);
        if( !mwindow->preferences->get_asset_file_path(asset, file_name) ) {
                switch( asset->format ) {
                case FILE_MPEG:
-                       FileMPEG::get_info(asset->path, file_name, &info[0]);
+                       FileMPEG::get_info(asset->path, file_name, &info[0],len);
                        break;
                case FILE_FFMPEG:
-                       FileFFMPEG::get_info(asset->path, &info[0]);
+                       FileFFMPEG::get_info(asset->path, &info[0],len);
                        break;
                }
        }
@@ -830,11 +836,10 @@ void DetailAssetWindow::create_objects()
 
 void DetailAssetThread::start(Asset *asset)
 {
-       if( !Thread::running() ) {
-               delete dwindow;
-               dwindow = new DetailAssetWindow(mwindow, asset);
-               Thread::start();
-       }
+       stop();
+       delete dwindow;
+       dwindow = new DetailAssetWindow(mwindow, asset);
+       Thread::start();
 }
 
 void DetailAssetThread::run()