summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2012-10-08 00:20:10 +0100
committerCarl Hetherington <cth@carlh.net>2012-10-08 00:20:10 +0100
commitd7801f3fe5a5ac46aa2c512bcd00be2bee39ed17 (patch)
treefcffa66cf84fb08c55e5547c5551d604df03dcec /src/lib
parent7c798f9e215282afb078da53b1d41d4c99e11f5d (diff)
Present fixed formats with video content and variable formats with stills.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/format.cc41
-rw-r--r--src/lib/format.h2
2 files changed, 1 insertions, 42 deletions
diff --git a/src/lib/format.cc b/src/lib/format.cc
index 115e03691..aaf5211f9 100644
--- a/src/lib/format.cc
+++ b/src/lib/format.cc
@@ -123,34 +123,6 @@ Format::from_metadata (string m)
return from_id (m);
}
-/** @param f A Format.
- * @return Index of f within our static list, or -1.
- */
-int
-Format::as_index (Format const * f)
-{
- vector<Format*>::size_type i = 0;
- while (i < _formats.size() && _formats[i] != f) {
- ++i;
- }
-
- if (i == _formats.size ()) {
- return -1;
- }
-
- return i;
-}
-
-/** @param i An index returned from as_index().
- * @return Corresponding Format.
- */
-Format const *
-Format::from_index (int i)
-{
- assert (i >= 0 && i < int(_formats.size ()));
- return _formats[i];
-}
-
/** @return All available formats */
vector<Format const *>
Format::all ()
@@ -205,16 +177,5 @@ VariableFormat::ratio_as_float (Film const * f) const
string
VariableFormat::name () const
{
- stringstream s;
- if (!_nickname.empty ()) {
- s << _nickname << " (";
- }
-
- s << "without stretching";
-
- if (!_nickname.empty ()) {
- s << ")";
- }
-
- return s.str ();
+ return _nickname;
}
diff --git a/src/lib/format.h b/src/lib/format.h
index 6172dc57d..fd6cdbece 100644
--- a/src/lib/format.h
+++ b/src/lib/format.h
@@ -71,9 +71,7 @@ public:
static Format const * from_nickname (std::string n);
static Format const * from_metadata (std::string m);
- static Format const * from_index (int i);
static Format const * from_id (std::string i);
- static int as_index (Format const * f);
static std::vector<Format const *> all ();
static void setup_formats ();