summaryrefslogtreecommitdiff
path: root/src/wx/content_properties_dialog.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-06-21 19:12:44 +0100
committerCarl Hetherington <cth@carlh.net>2015-06-21 19:12:44 +0100
commitfe771b1f0ed9f794bc98faa4cca2a15651f28e87 (patch)
treeae4366fcdd84796bcb75d3012893929f7bc2c71f /src/wx/content_properties_dialog.cc
parent6ec7654b77b22d32cb1ca0dd35c8d66e16ca36d6 (diff)
Add more video properties to content properties dialog.
Also implement the whole properties thing more neatly.
Diffstat (limited to 'src/wx/content_properties_dialog.cc')
-rw-r--r--src/wx/content_properties_dialog.cc40
1 files changed, 8 insertions, 32 deletions
diff --git a/src/wx/content_properties_dialog.cc b/src/wx/content_properties_dialog.cc
index 7fb0cccba..4f92e53ce 100644
--- a/src/wx/content_properties_dialog.cc
+++ b/src/wx/content_properties_dialog.cc
@@ -27,6 +27,8 @@
#include <boost/algorithm/string.hpp>
using std::string;
+using std::list;
+using std::pair;
using boost::shared_ptr;
using boost::dynamic_pointer_cast;
@@ -35,40 +37,14 @@ ContentPropertiesDialog::ContentPropertiesDialog (wxWindow* parent, shared_ptr<C
{
string n = content->path(0).string();
boost::algorithm::replace_all (n, "&", "&&");
- add_property (_("Filename"), std_to_wx (n));
+ add (_("Filename"), true);
+ add (new wxStaticText (this, wxID_ANY, std_to_wx (n)));
- shared_ptr<VideoContent> video = dynamic_pointer_cast<VideoContent> (content);
- if (video) {
- add_property (
- _("Video length"),
- std_to_wx (raw_convert<string> (video->video_length ())) + " " + _("video frames")
- );
- add_property (
- _("Video size"),
- std_to_wx (raw_convert<string> (video->video_size().width) + "x" + raw_convert<string> (video->video_size().height))
- );
- add_property (
- _("Video frame rate"),
- std_to_wx (raw_convert<string> (video->video_frame_rate())) + " " + _("frames per second")
- );
- }
-
- /* XXX: this could be better wrt audio streams */
-
- shared_ptr<SingleStreamAudioContent> single = dynamic_pointer_cast<SingleStreamAudioContent> (content);
- if (single) {
- add_property (
- _("Audio channels"),
- std_to_wx (raw_convert<string> (single->audio_stream()->channels ()))
- );
+ list<pair<string, string> > properties = content->properties ();
+ for (list<pair<string, string> >::const_iterator i = properties.begin(); i != properties.end(); ++i) {
+ add (std_to_wx (i->first), true);
+ add (new wxStaticText (this, wxID_ANY, std_to_wx (i->second)));
}
layout ();
}
-
-void
-ContentPropertiesDialog::add_property (wxString k, wxString v)
-{
- add (k, true);
- add (new wxStaticText (this, wxID_ANY, v));
-}