[vlc-devel] commit: Move the track id from the last column to the first one in the playlist dialog and add VLC_META_ENGINE_DURATION in vlc_meta .h ( Rémi Duraffort )

git version control git at videolan.org
Sat Mar 8 21:40:19 CET 2008


vlc | branch: master | Rémi Duraffort <ivoire at via.ecp.fr> | Sat Mar  8 21:37:03 2008 +0100| [dd99cec11682b1f038dd2804c02413eb17334966]

Move the track id from the last column to the first one in the playlist dialog and add VLC_META_ENGINE_DURATION in vlc_meta.h

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=dd99cec11682b1f038dd2804c02413eb17334966
---

 include/vlc_meta.h                                 |   26 ++++++++++---------
 .../gui/qt4/components/playlist/playlist_item.cpp  |    6 ++--
 .../gui/qt4/components/playlist/playlist_model.cpp |   23 +++++++++--------
 .../gui/qt4/components/playlist/standardpanel.cpp  |    2 +-
 modules/gui/qt4/qt4.hpp                            |    4 ---
 5 files changed, 30 insertions(+), 31 deletions(-)

diff --git a/include/vlc_meta.h b/include/vlc_meta.h
index 5949aff..242f8af 100644
--- a/include/vlc_meta.h
+++ b/include/vlc_meta.h
@@ -166,6 +166,7 @@ static inline void vlc_meta_Merge( vlc_meta_t *dst, const vlc_meta_t *src )
 /* Shortcuts for the AddInfo */
 #define VLC_META_INFO_CAT           N_("Meta-information")
 #define VLC_META_TITLE              input_MetaTypeToLocalizedString( vlc_meta_Title )
+#define VLC_META_DURATION           N_( "Duration" )
 #define VLC_META_ARTIST             input_MetaTypeToLocalizedString( vlc_meta_Artist )
 #define VLC_META_GENRE              input_MetaTypeToLocalizedString( vlc_meta_Genre )
 #define VLC_META_COPYRIGHT          input_MetaTypeToLocalizedString( vlc_meta_Copyright )
@@ -195,18 +196,19 @@ struct meta_export_t
     const char *psz_file;
 };
 
-#define VLC_META_ENGINE_TITLE           0x00000001
-#define VLC_META_ENGINE_ARTIST          0x00000004
-#define VLC_META_ENGINE_GENRE           0x00000008
-#define VLC_META_ENGINE_COPYRIGHT       0x00000010
-#define VLC_META_ENGINE_COLLECTION      0x00000020
-#define VLC_META_ENGINE_SEQ_NUM         0x00000040
-#define VLC_META_ENGINE_DESCRIPTION     0x00000080
-#define VLC_META_ENGINE_RATING          0x00000100
-#define VLC_META_ENGINE_DATE            0x00000200
-#define VLC_META_ENGINE_URL             0x00000400
-#define VLC_META_ENGINE_LANGUAGE        0x00000800
-#define VLC_META_ENGINE_TRACKID         0x00001000
+#define VLC_META_ENGINE_TRACKID         0x00000001
+#define VLC_META_ENGINE_TITLE           0x00000002
+#define VLC_META_ENGINE_DURATION        0x00000004
+#define VLC_META_ENGINE_ARTIST          0x00000008
+#define VLC_META_ENGINE_GENRE           0x00000010
+#define VLC_META_ENGINE_COPYRIGHT       0x00000020
+#define VLC_META_ENGINE_COLLECTION      0x00000040
+#define VLC_META_ENGINE_SEQ_NUM         0x00000080
+#define VLC_META_ENGINE_DESCRIPTION     0x00000100
+#define VLC_META_ENGINE_RATING          0x00000200
+#define VLC_META_ENGINE_DATE            0x00000400
+#define VLC_META_ENGINE_URL             0x00000800
+#define VLC_META_ENGINE_LANGUAGE        0x00001000
 
 #define VLC_META_ENGINE_ART_URL         0x00002000
 
diff --git a/modules/gui/qt4/components/playlist/playlist_item.cpp b/modules/gui/qt4/components/playlist/playlist_item.cpp
index 02dbc6b..2c9fd9a 100644
--- a/modules/gui/qt4/components/playlist/playlist_item.cpp
+++ b/modules/gui/qt4/components/playlist/playlist_item.cpp
@@ -115,6 +115,9 @@ void PLItem::updateColumnHeaders()
         {
             switch( i_index )
             {
+            case VLC_META_ENGINE_TRACKID:
+                item_col_strings.append( qtr( VLC_META_TRACKID ) );
+                break;
             case VLC_META_ENGINE_ARTIST:
                 item_col_strings.append( qtr( VLC_META_ARTIST ) );
                 break;
@@ -136,9 +139,6 @@ void PLItem::updateColumnHeaders()
             case VLC_META_ENGINE_SEQ_NUM:
                 item_col_strings.append( qtr( VLC_META_SEQ_NUM ) );
                 break;
-            case VLC_META_ENGINE_TRACKID:
-                item_col_strings.append( qtr( VLC_META_TRACKID ) );
-                break;
             default:
                 break;
             }
diff --git a/modules/gui/qt4/components/playlist/playlist_model.cpp b/modules/gui/qt4/components/playlist/playlist_model.cpp
index 620ba18..99fe339 100644
--- a/modules/gui/qt4/components/playlist/playlist_model.cpp
+++ b/modules/gui/qt4/components/playlist/playlist_model.cpp
@@ -727,6 +727,8 @@ void PLModel::sort( int column, Qt::SortOrder order )
         goto next;                                  \
     }                                               \
 }
+
+    CHECK_COLUMN( TRACKID );
     CHECK_COLUMN( TITLE );
     CHECK_COLUMN( DURATION );
     CHECK_COLUMN( ARTIST );
@@ -734,7 +736,6 @@ void PLModel::sort( int column, Qt::SortOrder order )
     CHECK_COLUMN( COLLECTION );
     CHECK_COLUMN( SEQ_NUM );
     CHECK_COLUMN( DESCRIPTION );
-    CHECK_COLUMN( TRACKID );
 
 #undef CHECK_COLUMN
 
@@ -747,6 +748,7 @@ next:
         int i_mode;
         switch( i_flag )
         {
+        case VLC_META_ENGINE_TRACKID:    i_mode = SORT_ID;               break;
         case VLC_META_ENGINE_TITLE:      i_mode = SORT_TITLE_NODES_FIRST;break;
         case VLC_META_ENGINE_DURATION:   i_mode = SORT_DURATION;         break;
         case VLC_META_ENGINE_ARTIST:     i_mode = SORT_ARTIST;           break;
@@ -754,7 +756,6 @@ next:
         case VLC_META_ENGINE_COLLECTION: i_mode = SORT_ALBUM;            break;
         case VLC_META_ENGINE_SEQ_NUM:    i_mode = SORT_TRACK_NUMBER;     break;
         case VLC_META_ENGINE_DESCRIPTION:i_mode = SORT_DESCRIPTION;      break;
-        case VLC_META_ENGINE_TRACKID:    i_mode = SORT_ID;               break;
         default:                         i_mode = SORT_TITLE_NODES_FIRST;break;
         }
         if( p_root )
@@ -830,23 +831,23 @@ void PLModel::viewchanged( int meta )
         int index=0;
         switch( meta )
         {
-        case VLC_META_ENGINE_TITLE:
+        case VLC_META_ENGINE_TRACKID:
             index=0; break;
-        case VLC_META_ENGINE_DURATION:
+        case VLC_META_ENGINE_TITLE:
             index=1; break;
-        case VLC_META_ENGINE_ARTIST:
+        case VLC_META_ENGINE_DURATION:
             index=2; break;
-        case VLC_META_ENGINE_GENRE:
+        case VLC_META_ENGINE_ARTIST:
             index=3; break;
-        case VLC_META_ENGINE_COPYRIGHT:
+        case VLC_META_ENGINE_GENRE:
             index=4; break;
-        case VLC_META_ENGINE_COLLECTION:
+        case VLC_META_ENGINE_COPYRIGHT:
             index=5; break;
-        case VLC_META_ENGINE_SEQ_NUM:
+        case VLC_META_ENGINE_COLLECTION:
             index=6; break;
-        case VLC_META_ENGINE_DESCRIPTION:
+        case VLC_META_ENGINE_SEQ_NUM:
             index=7; break;
-        case VLC_META_ENGINE_TRACKID:
+        case VLC_META_ENGINE_DESCRIPTION:
             index=8; break;
         default:
             break;
diff --git a/modules/gui/qt4/components/playlist/standardpanel.cpp b/modules/gui/qt4/components/playlist/standardpanel.cpp
index d3e486a..be76a24 100644
--- a/modules/gui/qt4/components/playlist/standardpanel.cpp
+++ b/modules/gui/qt4/components/playlist/standardpanel.cpp
@@ -274,6 +274,7 @@ void StandardPLPanel::popupSelectColumn( QPoint pos )
 
     CONNECT( ContextUpdateMapper, mapped( int ),  model, viewchanged( int ) );
 
+    ADD_META_ACTION( TRACKID );
     ADD_META_ACTION( TITLE );
     ADD_META_ACTION( DURATION );
     ADD_META_ACTION( ARTIST );
@@ -281,7 +282,6 @@ void StandardPLPanel::popupSelectColumn( QPoint pos )
     ADD_META_ACTION( COLLECTION );
     ADD_META_ACTION( SEQ_NUM );
     ADD_META_ACTION( DESCRIPTION );
-    ADD_META_ACTION( TRACKID );
 
 #undef ADD_META_ACTION
 
diff --git a/modules/gui/qt4/qt4.hpp b/modules/gui/qt4/qt4.hpp
index 220fc28..c06c5fb 100644
--- a/modules/gui/qt4/qt4.hpp
+++ b/modules/gui/qt4/qt4.hpp
@@ -37,10 +37,6 @@
 
 #define HAS_QT43 ( QT_VERSION >= 0x040300 )
 
-/* Add define for duration, VLC_META_ENGINE doesn't include it */
-#define VLC_META_ENGINE_DURATION   0x00000002
-#define VLC_META_DURATION          N_( "Duration" )
-
 #define QT_NORMAL_MODE 0
 #define QT_ALWAYS_VIDEO_MODE 1
 #define QT_MINIMAL_MODE 2




More information about the vlc-devel mailing list