map.set (i, i, 1);
}
} else {
- /* Special case: stereo output, at least 3 channel input, map L+R to L/R and
- C to both, all 3dB down.
+ /* Special case: stereo output, at least 3 channel input.
+ Map so that Lt = L(-3dB) + Ls(-3dB) + C(-6dB) + Lfe(-10dB)
+ Rt = R(-3dB) + Rs(-3dB) + C(-6dB) + Lfe(-10dB)
*/
- map.set (0, 0, 1 / sqrt(2)); // L -> L
- map.set (1, 1, 1 / sqrt(2)); // R -> R
- map.set (2, 0, 1 / sqrt(2)); // C -> L
- map.set (2, 1, 1 / sqrt(2)); // C -> R
+ map.set (dcp::LEFT, 0, 1 / sqrt(2)); // L -> Lt
+ map.set (dcp::RIGHT, 1, 1 / sqrt(2)); // R -> Rt
+ map.set (dcp::CENTRE, 0, 1 / 2.0); // C -> Lt
+ map.set (dcp::CENTRE, 1, 1 / 2.0); // C -> Rt
+ map.set (dcp::LFE, 0, 1 / sqrt(10)); // Lfe -> Lt
+ map.set (dcp::LFE, 1, 1 / sqrt(10)); // Lfe -> Rt
+ map.set (dcp::LS, 0, 1 / sqrt(2)); // Ls -> Lt
+ map.set (dcp::RS, 1, 1 / sqrt(2)); // Rs -> Rt
}
_butler.reset (new Butler (_player, _film->log(), map, _audio_channels));
}
DCPTime t (_slider->GetValue() * _film->length().get() / 4096);
+ t = t.round (_film->video_frame_rate());
/* Ensure that we hit the end of the film at the end of the slider */
if (t >= _film->length ()) {
t = _film->length() - one_video_frame();
void
FilmViewer::start ()
{
+ if (!_film) {
+ return;
+ }
+
if (_audio.isStreamOpen()) {
_audio.setStreamTime (_video_position.seconds());
_audio.startStream ();
}
DCPTime
-FilmViewer::nudge_amount (wxMouseEvent& ev)
+FilmViewer::nudge_amount (wxKeyboardState& ev)
{
DCPTime amount = one_video_frame ();
}
void
-FilmViewer::back_clicked (wxMouseEvent& ev)
+FilmViewer::back_frame ()
+{
+ if (!_film) {
+ return;
+ }
+
+ go_to (_video_position - one_video_frame());
+}
+
+void
+FilmViewer::forward_frame ()
+{
+ if (!_film) {
+ return;
+ }
+
+ go_to (_video_position + one_video_frame());
+}
+
+void
+FilmViewer::back_clicked (wxKeyboardState& ev)
{
go_to (_video_position - nudge_amount (ev));
- ev.Skip ();
}
void
-FilmViewer::forward_clicked (wxMouseEvent& ev)
+FilmViewer::forward_clicked (wxKeyboardState& ev)
{
go_to (_video_position + nudge_amount (ev));
- ev.Skip ();
}
void
update_position_slider ();
}
+void
+FilmViewer::set_position (shared_ptr<Content> content, ContentTime t)
+{
+ set_position (_player->content_time_to_dcp (content, t));
+}
+
void
FilmViewer::set_coalesce_player_changes (bool c)
{
_audio.closeStream ();
}
- if (Config::instance()->sound()) {
+ if (Config::instance()->sound() && _audio.getDeviceCount() > 0) {
unsigned int st = 0;
if (Config::instance()->sound_output()) {
while (st < _audio.getDeviceCount()) {