~ubuntu-branches/ubuntu/saucy/mpd/saucy

« back to all changes in this revision

Viewing changes to src/output_command.c

  • Committer: Bazaar Package Importer
  • Author(s): Angel Abad
  • Date: 2011-02-02 12:26:30 UTC
  • mfrom: (1.5.11 upstream)
  • Revision ID: james.westby@ubuntu.com-20110202122630-bdyx8w4k94doz4fs
Tags: 0.16.1-1ubuntu1
* Merge from debian unstable. Remaining changes:
  - debian/control:
    + Don't build-depend on libmikmod2-dev (Debian bug #510675).
    + Move avahi-daemon from Suggests field to Recommends field.
  - debian/mpd.init.d:
    + Read mpd user from mpd.conf.
  - debian/control, debian/rules:
    + Add libmp3lame-dev to the build dependencies and enable lame.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (C) 2003-2009 The Music Player Daemon Project
 
2
 * Copyright (C) 2003-2010 The Music Player Daemon Project
3
3
 * http://www.musicpd.org
4
4
 *
5
5
 * This program is free software; you can redistribute it and/or modify
24
24
 *
25
25
 */
26
26
 
 
27
#include "config.h"
27
28
#include "output_command.h"
28
29
#include "output_all.h"
29
30
#include "output_internal.h"
30
31
#include "output_plugin.h"
31
32
#include "mixer_control.h"
 
33
#include "player_control.h"
32
34
#include "idle.h"
33
35
 
 
36
extern unsigned audio_output_state_version;
 
37
 
34
38
bool
35
39
audio_output_enable_index(unsigned idx)
36
40
{
40
44
                return false;
41
45
 
42
46
        ao = audio_output_get(idx);
 
47
        if (ao->enabled)
 
48
                return true;
43
49
 
44
50
        ao->enabled = true;
45
51
        idle_add(IDLE_OUTPUT);
46
52
 
 
53
        pc_update_audio();
 
54
 
 
55
        ++audio_output_state_version;
 
56
 
47
57
        return true;
48
58
}
49
59
 
57
67
                return false;
58
68
 
59
69
        ao = audio_output_get(idx);
 
70
        if (!ao->enabled)
 
71
                return true;
60
72
 
61
73
        ao->enabled = false;
62
74
        idle_add(IDLE_OUTPUT);
67
79
                idle_add(IDLE_MIXER);
68
80
        }
69
81
 
 
82
        pc_update_audio();
 
83
 
 
84
        ++audio_output_state_version;
 
85
 
70
86
        return true;
71
87
}