~ubuntu-branches/ubuntu/wily/oolite/wily-proposed

« back to all changes in this revision

Viewing changes to src/Core/OOMusicController.m

  • Committer: Package Import Robot
  • Author(s): Nicolas Boulenguez
  • Date: 2011-12-22 00:22:39 UTC
  • mfrom: (1.2.2)
  • Revision ID: package-import@ubuntu.com-20111222002239-pr3upeupp4jw1psp
Tags: 1.76-1
* New upstream.
* watch: scan upstream stable releases instead of dev snapshots.
* control: use default gobjc instead of explicit 4.6.
* rules: use dpkg-dev build flags.

Show diffs side-by-side

added added

removed removed

Lines of Context:
98
98
{
99
99
        if ([self isPlaying] && [name isEqual:[self playingMusic]])  return;
100
100
        
101
 
        if (_mode == kOOMusicOn)
 
101
        if (_mode == kOOMusicOn || (_mode == kOOMusicITunes && [name isEqualToString:@"OoliteTheme.ogg"]))
102
102
        {
103
103
                OOMusic *music = [ResourceManager ooMusicNamed:name inFolder:@"Music"];
104
104
                if (music != nil)
131
131
        }
132
132
        else
133
133
        {
134
 
                [self playMusicNamed:@"BlueDanube.ogg" loop:NO];
 
134
                [self playMusicNamed:@"BlueDanube.ogg" loop:YES];
135
135
        }
136
136
}
137
137
 
168
168
}
169
169
 
170
170
 
171
 
- (void) stop
 
171
// Stop without switching iTunes to in-flight music.
 
172
- (void) justStop
172
173
{
173
174
        [_current stop];
174
175
        [_current release];
175
176
        _current = nil;
176
177
        _special = kSpecialNone;
 
178
}
 
179
 
 
180
 
 
181
- (void) stop
 
182
{
 
183
        [self justStop];
177
184
        
178
185
        if (_mode == kOOMusicITunes)
179
186
        {
190
197
 
191
198
- (void) stopThemeMusic
192
199
{
193
 
        if (_special == kSpecialTheme)  [self stop];
 
200
        if (_special == kSpecialTheme)
 
201
        {
 
202
                [self justStop];
 
203
                [self playDockedMusic];
 
204
        }
194
205
}
195
206
 
196
207
 
237
248
{
238
249
        if (mode <= kOOMusicModeMax && _mode != mode)
239
250
        {
 
251
                if (_mode == kOOMusicITunes) [self pauseiTunes];
240
252
                _mode = mode;
241
253
                
242
254
                if (_mode == kOOMusicOff)  [self stop];
358
370
 
359
371
- (void) pauseiTunes
360
372
{
361
 
        NSString *ootunesScriptString = [NSString stringWithFormat:@"try\nignoring application responses\ntell application \"iTunes\" to pause\nend ignoring"];
 
373
        NSString *ootunesScriptString = [NSString stringWithFormat:@"try\nignoring application responses\ntell application \"iTunes\" to pause\nend ignoring\nend try"];
362
374
        NSAppleScript *ootunesScript = [[NSAppleScript alloc] initWithSource:ootunesScriptString];
363
375
        NSDictionary *errDict = nil;
364
376
        [ootunesScript executeAndReturnError:&errDict];