~ubuntu-branches/ubuntu/maverick/ultrastar-ng/maverick

« back to all changes in this revision

Viewing changes to audio/audio.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Miriam Ruiz, Miriam Ruiz, Mario Bonino, Jon Dowland, Ansgar Burchardt
  • Date: 2008-06-07 16:43:18 UTC
  • mfrom: (1.1.2 upstream)
  • mto: This revision was merged to the branch mainline in revision 6.
  • Revision ID: james.westby@ubuntu.com-20080607164318-spq0cnpt8mjhg1pj
[ Miriam Ruiz ]
* New Upstream Release (Closes: #453132)
* Removed unneeded patches
* Added packages to build deps:
  + libtool
  + portaudio19-dev | portaudio-dev
  + libboost-dev, libboost-thread-dev, libboost-serialization-dev
  + libboost-program-options-dev, libboost-regex-dev
* Moved shared objects to private directory: /usr/lib/ultraster-ng
* Added rpath to binaries to search for shared objects in the private dir
* Uses ultrastar-ng-gstreamer as default, instead of ultrastar-ng-xine,
  since there are significantly less issues with GStreamer.
* Added patch to fix upstream desktop file
* Added -Wl,-as-needed to LDFLAGS
* Replaced fftw3-dev by libfftw3-dev in build dependencies.
* Standards-Version upgraded to 3.7.3

[ Mario Bonino ]
* Fixed data/Makefile.am to install .desktop file and icon

[ Jon Dowland ]
* add Homepage: control field to source stanza
* fix a bashism in debian/rules (Closes: #478634)

[ Ansgar Burchardt ]
* debian/control: Change XS-Vcs-* to Vcs-*
* Remove Homepage semi-field from description

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include "audio_dev.hpp"
 
2
#include <ostream>
 
3
#include <limits>
 
4
 
 
5
namespace da {
 
6
        const std::size_t settings::low = std::numeric_limits<std::size_t>::min();
 
7
        const std::size_t settings::high = std::numeric_limits<std::size_t>::max();
 
8
 
 
9
        namespace {
 
10
                std::string none = "none";
 
11
        }
 
12
 
 
13
        record::devlist_t record::devices() {
 
14
                devlist_t l(record_plugin::begin(), record_plugin::end());
 
15
                l.push_back(devinfo(none, "No device. Will not receive any audio data."));
 
16
                return l;
 
17
        }
 
18
 
 
19
        record::record(settings& s): m_handle() {
 
20
                if (s.device() == none) return;
 
21
                if (record_plugin::empty()) throw std::runtime_error("No recording devices installed");
 
22
                if (s.device().empty()) {
 
23
                        // Try all normal devices
 
24
                        for (record_plugin::iterator it = record_plugin::begin(); it != record_plugin::end(); ++it) {
 
25
                                if (it->special()) continue;
 
26
                                try {
 
27
                                        s.debug(">>> Recording from " + it->name());
 
28
                                        m_handle = it(s);
 
29
                                        s.set_device(it->name());
 
30
                                        return;
 
31
                                } catch (std::exception& e) {
 
32
                                        s.debug(std::string("-!- ") + e.what());
 
33
                                }
 
34
                        }
 
35
                        throw std::runtime_error("No recording devices could be used");
 
36
                } else {
 
37
                        s.debug(">>> Using recording device " + s.device());
 
38
                        try {
 
39
                                m_handle = record_plugin::find(s.device())(s);
 
40
                        } catch (record_plugin::invalid_key_error&) {
 
41
                                throw std::runtime_error("Recording device " + s.device() + " not found");
 
42
                        }
 
43
                }
 
44
        }
 
45
 
 
46
        record::~record() { delete m_handle; }
 
47
}
 
48