~ubuntu-branches/ubuntu/saucy/gnash/saucy-proposed

« back to all changes in this revision

Viewing changes to libcore/asobj/Sound_as.cpp

  • Committer: Package Import Robot
  • Author(s): Micah Gersten
  • Date: 2012-03-04 03:19:06 UTC
  • mfrom: (1.1.18) (3.1.24 sid)
  • Revision ID: package-import@ubuntu.com-20120304031906-p6q5rnb0xhgpof7o
Tags: 0.8.10-3ubuntu1
* Merge from Debian testing (FFe: LP: #940876), remaining changes:
  - Use mozilla-flashplugin as the alternative for now
  - Change xulrunner-dev build dep to firefox-dev
* Drop the plugin API porting patch, this has been fixed upstream
  - drop debian/patches*
* Drop the following change as we want Adobe's player to take priority
  if it's installed
  - Set alternative priority to 50 so that it matches Adobe Flash's priority

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
// Sound_as.cpp:  ActionScript "Sound" class, for Gnash.
2
2
//
3
 
//   Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc.
 
3
//   Copyright (C) 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
4
4
//
5
5
// This program is free software; you can redistribute it and/or modify
6
6
// it under the terms of the GNU General Public License as published by
425
425
 
426
426
        if ( ! _inputStream ) {
427
427
            if ( parsingCompleted ) {
428
 
                log_debug("No audio in Sound input.");
 
428
                log_error(_("No audio in Sound input."));
429
429
                stopProbeTimer();
430
430
                _mediaParser.reset(); // no use for this anymore...
431
431
            } else {
514
514
        DisplayObject* ch = _attachedCharacter->get();
515
515
        if (! ch) {
516
516
            log_debug("Character attached to Sound was unloaded and "
517
 
                    "couldn't rebind");
 
517
                        "couldn't rebind");
518
518
            return false;
519
519
        }
520
520
        volume = ch->getVolume();
578
578
                rcfile.saveStreamingMedia()));
579
579
 
580
580
    if (!inputStream.get()) {
581
 
        log_error( _("Gnash could not open this url: %s"), url );
 
581
        log_error(_("Gnash could not open this URL: %s"), url );
582
582
        // dispatch onLoad (false)
583
583
        callMethod(&owner(), NSV::PROP_ON_LOAD, false);
584
584
        return;
673
673
Sound_as::start(double secOff, int loops)
674
674
{
675
675
    if ( ! _soundHandler ) {
676
 
        log_error("No sound handler, nothing to start...");
 
676
        log_error(_("No sound handler, nothing to start..."));
677
677
        return;
678
678
    }
679
679
 
680
680
    if (externalSound) {
681
681
        if ( ! _mediaParser ) {
682
 
            log_error("No MediaParser initialized, can't start an external sound");
 
682
            log_error(_("No MediaParser initialized, can't start an external sound"));
683
683
            return;
684
684
        }
685
685
 
732
732
Sound_as::stop(int si)
733
733
{
734
734
    if ( ! _soundHandler ) {
735
 
        log_error("No sound handler, nothing to stop...");
 
735
        log_error(_("No sound handler, nothing to stop..."));
736
736
        return;
737
737
    }
738
738
 
760
760
Sound_as::getDuration() const
761
761
{
762
762
    if ( ! _soundHandler ) {
763
 
        log_error("No sound handler, can't check duration...");
 
763
        log_error(_("No sound handler, can't check duration..."));
764
764
        return 0;
765
765
    }
766
766
 
785
785
Sound_as::getPosition() const
786
786
{
787
787
    if (!_soundHandler) {
788
 
        log_error("No sound handler, can't check position (we're "
789
 
                "likely not playing anyway)...");
 
788
        log_error(_("No sound handler, can't check position (we're "
 
789
                    "likely not playing anyway)..."));
790
790
        return 0;
791
791
    }
792
792
 
852
852
            _leftOverData.reset( _audioDecoder->decode(*frame, _leftOverSize) );
853
853
            _leftOverPtr = _leftOverData.get();
854
854
            if ( ! _leftOverData ) {
855
 
                log_error("No samples decoded from input of %d bytes", frame->dataSize);
 
855
                log_error(_("No samples decoded from input of %d bytes"),
 
856
                          frame->dataSize);
856
857
                continue;
857
858
            }
858
859
 
951
952
        IF_VERBOSE_ASCODING_ERRORS(
952
953
            if (fn.nargs > 1) {
953
954
                std::stringstream ss; fn.dump_args(ss);
954
 
                log_aserror("new Sound(%d) : args after first one ignored",
 
955
                log_aserror(_("new Sound(%d) : args after first one ignored"),
955
956
                    ss.str());
956
957
            }
957
958
        );
958
959
 
959
 
 
960
960
        const as_value& arg0 = fn.arg(0);
961
961
 
962
962
        if (!arg0.is_null() && !arg0.is_undefined()) {
966
966
            IF_VERBOSE_ASCODING_ERRORS(
967
967
                if (!ch) {
968
968
                    std::stringstream ss; fn.dump_args(ss);
969
 
                    log_aserror("new Sound(%s) : first argument isn't null "
 
969
                    log_aserror(_("new Sound(%s) : first argument isn't null "
970
970
                        "or undefined, and isn't a DisplayObject. "
971
 
                        "We'll take as an invalid DisplayObject ref.",
 
971
                                  "We'll take as an invalid DisplayObject ref."),
972
972
                        ss.str());
973
973
                }
974
974
            );
1124
1124
as_value
1125
1125
sound_getpan(const fn_call& /*fn*/)
1126
1126
{
1127
 
    LOG_ONCE( log_unimpl ("Sound.getPan()") );
 
1127
    LOG_ONCE(log_unimpl(_("Sound.getPan()")));
1128
1128
    return as_value();
1129
1129
}
1130
1130
 
1139
1139
as_value
1140
1140
sound_setDuration(const fn_call& /*fn*/)
1141
1141
{
1142
 
    LOG_ONCE( log_unimpl ("Sound.setDuration()") );
 
1142
    LOG_ONCE(log_unimpl(_("Sound.setDuration()")));
1143
1143
    return as_value();
1144
1144
}
1145
1145
 
1154
1154
as_value
1155
1155
sound_setPosition(const fn_call& /*fn*/)
1156
1156
{
1157
 
    LOG_ONCE( log_unimpl ("Sound.setPosition()") );
 
1157
    LOG_ONCE(log_unimpl(_("Sound.setPosition()")));
1158
1158
    return as_value();
1159
1159
}
1160
1160
 
1161
1161
as_value
1162
1162
sound_gettransform(const fn_call& /*fn*/)
1163
1163
{
1164
 
    LOG_ONCE( log_unimpl ("Sound.getTransform()") );
 
1164
    LOG_ONCE( log_unimpl(_("Sound.getTransform()")));
1165
1165
    return as_value();
1166
1166
}
1167
1167
 
1173
1173
 
1174
1174
    if ( fn.nargs ) {
1175
1175
        IF_VERBOSE_ASCODING_ERRORS(
1176
 
        std::stringstream ss; fn.dump_args(ss);
1177
 
        log_aserror("Sound.getVolume(%s) : arguments ignored");
 
1176
            std::stringstream ss; fn.dump_args(ss);
 
1177
            log_aserror(_("Sound.getVolume(%s) : arguments ignored"));
1178
1178
        );
1179
1179
    }
1180
1180
 
1219
1219
as_value
1220
1220
sound_setpan(const fn_call& /*fn*/)
1221
1221
{
1222
 
    LOG_ONCE( log_unimpl ("Sound.setPan()") );
 
1222
    LOG_ONCE(log_unimpl(_("Sound.setPan()")));
1223
1223
    return as_value();
1224
1224
}
1225
1225
 
1226
1226
as_value
1227
1227
sound_settransform(const fn_call& /*fn*/)
1228
1228
{
1229
 
    LOG_ONCE( log_unimpl ("Sound.setTransform()") );
 
1229
    LOG_ONCE(log_unimpl(_("Sound.setTransform()")));
1230
1230
    return as_value();
1231
1231
}
1232
1232
 
1250
1250
as_value
1251
1251
checkPolicyFile_getset(const fn_call& /*fn*/)
1252
1252
{
1253
 
    LOG_ONCE( log_unimpl ("Sound.checkPolicyFile") );
 
1253
    LOG_ONCE(log_unimpl(_("Sound.checkPolicyFile")));
1254
1254
    return as_value();
1255
1255
}
1256
1256
 
1263
1263
    // 
1264
1264
    // naive test shows this always being undefined..
1265
1265
    //
1266
 
    LOG_ONCE( log_unimpl ("Sound.areSoundsInaccessible()") );
 
1266
    LOG_ONCE(log_unimpl(_("Sound.areSoundsInaccessible()")));
1267
1267
    return as_value();
1268
1268
}
1269
1269