Commits

Leyorus committed ab0e145

fix compilation problem

Comments (0)

Files changed (5)

src/core/Common.h

 		std::string type;
 		std::string codec;
 		std::string language;
+		int size;
 		track_info_t() {
 			num = "0";
 			type = "unknown";
 			codec = "unknown";
 			language = "unknown";
+			size = 0;
 		}
 	}track_info_t;
 

src/core/MkvExtractor.cpp

 #include "MkvExtractor.h"
 
 #include <iostream>
+#include <unistd.h>
 #include <map>
 
 #include "Common.h"

src/core/MkvInfoParser.cpp

 		typedef std::deque<Segment::TTracks::TPayload::TTrack> TTrackList;
 		TTrackList trackList = segment.payload_.tracks_.payload_.tracks_;
 
-		for (TTrackList::iterator it = trackList.begin(); it != trackList.end();
-				it++) {
+		for (TTrackList::iterator it = trackList.begin(); it != trackList.end(); it++) {
 			track_info_t track;
 			track.num = toString(it->payload_.trackNumber_.payload_.get() - 1); // (-1) used for compatiblity with mkvextract utility (to solve later)
-			track.type = getTrackTypeName(
-					it->payload_.trackType_.payload_.get());
+			track.type = getTrackTypeName(it->payload_.trackType_.payload_.get());
 			track.codec = it->payload_.codecID_.payload_.get();
 			track.language = it->payload_.language_.payload_.get();
+			track.size = 0; //segment.payload_.clusters_.front().calcSize();
 			tracks.push_back(track);
 		}
 	}

src/gtk-gui/MainWindow.cpp

 const std::string columnHeaderTypeText = _("Type");
 const std::string columnHeaderCodecText = _("Codec");
 const std::string columnHeaderLanguageText = _("Language");
+const std::string columnHeaderSizeText = _("Size");
 const std::string columnHeaderOutputFileNameText = _("Output filename");
 
 const std::string statusLabelTextChooseInputFile = _("Choose input file");
 			labelTable(1,2,true),
 			commandLineFrame(commandLineFrameName),
 			askedCancel(false),
-			verbose(false)
+			verbose(true)
 {
     /* force using icons on stock buttons: */
     showIconOnButton();
 	trackList.append_column(columnHeaderTypeText, m_Columns.m_col_type);
 	trackList.append_column(columnHeaderCodecText, m_Columns.m_col_codec);
 	trackList.append_column(columnHeaderLanguageText, m_Columns.m_col_language);
+//	trackList.append_column(columnHeaderSizeText, m_Columns.m_col_size);
 	trackList.append_column_editable(columnHeaderOutputFileNameText, m_Columns.m_col_outputFileName);
 
 	std::vector<Gtk::TreeViewColumn*> columns = trackList.get_columns();
     	row[m_Columns.m_col_type] = i->type;
     	row[m_Columns.m_col_codec] = i->codec;
     	row[m_Columns.m_col_language] = i->language;
+//    	row[m_Columns.m_col_size] = i->size;
     	row[m_Columns.m_col_outputFileName] = Core::MkvExtractor::getDefaultFileName(*i);
     	tracksToExtract[Core::toInteger(i->num)] = false;
     }
 std::string MainWindow::getFileName(int id) {
 	Gtk::TreeModel::Path path(Core::toString(id));
 	Gtk::TreeModel::Row row = *(refListStore->get_iter(path));
-	std::string name;
-	row.get_value(5, name);
-	return name;
+	return std::string(row[m_Columns.m_col_outputFileName]);
 }
 
 bool MainWindow::stopExtraction() {

src/gtk-gui/MainWindow.h

 		add(m_col_type);
 		add(m_col_codec);
 		add(m_col_language);
+//		add(m_col_size);
 		add(m_col_outputFileName);
 	}
 
 	Gtk::TreeModelColumn<Glib::ustring> m_col_type;
 	Gtk::TreeModelColumn<Glib::ustring> m_col_codec;
 	Gtk::TreeModelColumn<Glib::ustring> m_col_language;
-	Gtk::TreeModelColumn<Glib::ustring> m_col_outputFileName;
+//	Gtk::TreeModelColumn<int> m_col_size;
+	Gtk::TreeModelColumn<std::string> m_col_outputFileName;
 };
 
 class MainWindow: public Gtk::Window {