~fluendo-elisa/moovida/elisa-pancake

« back to all changes in this revision

Viewing changes to elisa-plugins/elisa/plugins/poblesec/player_base.py

  • Committer: pancake
  • Date: 2009-03-27 12:16:38 UTC
  • mfrom: (1115.2.37 elisa)
  • Revision ID: pancake@flubox-20090327121638-2da0c1a0zu3byufd
* Merge against the head

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- coding: utf-8 -*-
 
2
# Elisa - Home multimedia server
 
3
# Copyright (C) 2006-2008 Fluendo Embedded S.L. (www.fluendo.com).
 
4
# All rights reserved.
 
5
#
 
6
# This file is available under one of two license agreements.
 
7
#
 
8
# This file is licensed under the GPL version 3.
 
9
# See "LICENSE.GPL" in the root of this distribution including a special
 
10
# exception to use Elisa with Fluendo's plugins.
 
11
#
 
12
# The GPL part of Elisa is also available under a commercial licensing
 
13
# agreement from Fluendo.
 
14
# See "LICENSE.Elisa" in the root directory of this distribution package
 
15
# for details on that license.
 
16
 
 
17
from elisa.plugins.pigment.pigment_controller import PigmentController
 
18
 
 
19
class BasePlayerController(PigmentController):
 
20
    needs = []
 
21
 
 
22
    def is_compatible(self, other_player):
 
23
        """ Check if the player can be used at same time than
 
24
        L{other_player}. Check is based on what each player needs. So
 
25
        if one player needs only AUDIO and another player only needs
 
26
        IMAGE, they are compatible.
 
27
 
 
28
        @param other_player: player to check against ours
 
29
        @type other_player: L{BasePlayerController}
 
30
        @rtype: bool
 
31
        """
 
32
        intersection = set(self.needs).intersection(set(other_player.needs))
 
33
        return len(intersection) == 0