コード例 #1
0
ファイル: wavectrl.py プロジェクト: drammock/sppas
    def __init__(self, parent, id=-1,
                 pos=wx.DefaultPosition,
                 size=wx.DefaultSize,
                 audio=None):
        """
        Constructor.

        Non-wxPython related parameter:
          - audio: the audio, already open by signals.open(f).

        """

        spControl.__init__(self, parent, id, pos, size)

        # Preferences
        self._preferences = WavePreferences()

        # Disable Pane (because each channel has its own pane)
        self._infopanep = wx.ALIGN_CENTRE

        # Members
        self._selectarea = SelectArea()
        self._m_dragging = False

        # Wave
        self.__set( audio )

        # Handling mouse moving.
        wx.EVT_MOUSE_EVENTS(self, self.OnMouseEvents)
コード例 #2
0
ファイル: trsctrl.py プロジェクト: drammock/sppas
    def __init__(self, parent, id=wx.ID_ANY,
                 pos=wx.DefaultPosition,
                 size=wx.DefaultSize,
                 trs=None):
        """
        Constructor.

        Non-wxPython related parameter:
        @param trs (Transcription) the object to display (see sppas.annodationdata)

        """
        # Members
        self._trs = trs
        self._tiers = None
        spControl.__init__(self, parent, id, pos, size)

        # Disable Pane (because each tier has its own pane)
        self._infopanep = wx.ALIGN_CENTRE

        # Members
        self._textalign = wx.ALIGN_CENTRE
        self._fontsizeauto = False

        # Transcription members
        self.__set( trs )
コード例 #3
0
ファイル: wavectrl.py プロジェクト: lym0302/sppas
    def __init__(self,
                 parent,
                 id=-1,
                 pos=wx.DefaultPosition,
                 size=wx.DefaultSize,
                 audio=None):
        """
        Constructor.

        Non-wxPython related parameter:
          - audio (sppasAudioPCM): the audio instance.

        """
        spControl.__init__(self, parent, id, pos, size)

        # Preferences
        self._preferences = WavePreferences()

        # Disable Pane (because each channel has its own pane)
        self._infopanep = wx.ALIGN_CENTRE

        # Members
        self._selectarea = SelectArea()
        self._m_dragging = False

        # Wave
        self.__set(audio)

        # Handling mouse moving.
        wx.EVT_MOUSE_EVENTS(self, self.OnMouseEvents)
コード例 #4
0
ファイル: timerulerctrl.py プロジェクト: gmontcheuil/sppas
    def __init__(self, parent, id=wx.ID_ANY,
                 pos=wx.DefaultPosition,
                 size=wx.DefaultSize):
        """
        Constructor.

        Notice that the style can't be changed. Fixed to NO_BORDER.

        """
        spControl.__init__(self, parent, id, pos, size)

        self.Reset()
        self.InitBuffer()

        # Bind the events related to our control:
        self.Bind(wx.EVT_MOUSE_EVENTS, self.OnMouseEvents)
コード例 #5
0
    def __init__(self,
                 parent,
                 id=wx.ID_ANY,
                 pos=wx.DefaultPosition,
                 size=wx.DefaultSize):
        """
        Constructor.

        Notice that the style can't be changed. Fixed to NO_BORDER.

        """
        spControl.__init__(self, parent, id, pos, size)

        self.Reset()
        self.InitBuffer()

        # Bind the events related to our control:
        self.Bind(wx.EVT_MOUSE_EVENTS, self.OnMouseEvents)
コード例 #6
0
ファイル: tierctrl.py プロジェクト: lym0302/sppas
    def __init__(self, parent, id=wx.ID_ANY,
                 pos=wx.DefaultPosition,
                 size=wx.DefaultSize,
                 tier=None):
        """
        Constructor.

        Non-wxpython related parameter:
            - tier (Tier) the Tier to draw (see annotationdata library for details).

        """
        self._tier = tier
        spControl.__init__(self, parent, id, pos, size)

        self.isselectable = False

        # Tier Members
        self._pointsctrl = list()
        self._labelsctrl = list()
        self._anns = {} # To link the annotations to the displayed controls

        # disable margins (then handles)
        self._margins.Left  = 0
        self._margins.Right = 0

        self._bgcolor = self.GetParent().GetBackgroundColour()
        self._bgpen   = wx.Pen( self._bgcolor, 1, wx.SOLID )
        self._bgbrush = wx.Brush( self._bgcolor, wx.SOLID )

        self._fgcolor = PickRandomColour(180,250)
        self._fgpen   = wx.Pen( self._fgcolor, 1, wx.SOLID )
        self._fgbrush = wx.Brush( self._fgcolor, wx.SOLID )

        self._midpointcolor = wx.BLACK

        if self._tier is not None and self._tier.IsPoint():
            self._labelalign = wx.ALIGN_LEFT # Label in each annotation
        else:
            self._labelalign = wx.ALIGN_CENTRE # Label in each annotation
        self._labelbgcolor  = self._fgcolor
        self._labelfgucolor = None # uncertain label

        self._fontsizeauto = True
        self.AutoAdjustFont()
コード例 #7
0
ファイル: tierctrl.py プロジェクト: drammock/sppas
    def __init__(self, parent, id=wx.ID_ANY,
                 pos=wx.DefaultPosition,
                 size=wx.DefaultSize,
                 tier=None):
        """
        Constructor.

        Non-wxpython related parameter:
            - tier (Tier) the Tier to draw (see annotationdata library for details).

        """
        self._tier = tier
        spControl.__init__(self, parent, id, pos, size)

        self.isselectable = False

        # Tier Members
        self._pointsctrl = list()
        self._labelsctrl = list()
        self._anns = {} # To link the annotations to the displayed controls

        # disable margins (then handles)
        self._margins.Left  = 0
        self._margins.Right = 0

        self._bgcolor = self.GetParent().GetBackgroundColour()
        self._bgpen   = wx.Pen( self._bgcolor, 1, wx.SOLID )
        self._bgbrush = wx.Brush( self._bgcolor, wx.SOLID )

        self._fgcolor = PickRandomColour(180,250)
        self._fgpen   = wx.Pen( self._fgcolor, 1, wx.SOLID )
        self._fgbrush = wx.Brush( self._fgcolor, wx.SOLID )

        self._midpointcolor = wx.BLACK

        if self._tier is not None and self._tier.IsPoint():
            self._labelalign = wx.ALIGN_LEFT # Label in each annotation
        else:
            self._labelalign = wx.ALIGN_CENTRE # Label in each annotation
        self._labelbgcolor  = self._fgcolor
        self._labelfgucolor = None # uncertain label

        self._fontsizeauto = True
        self.AutoAdjustFont()
コード例 #8
0
ファイル: channelctrl.py プロジェクト: gmontcheuil/sppas
    def __init__(self, parent, id=-1,
                 pos=wx.DefaultPosition,
                 size=wx.DefaultSize,
                 datamax=0):
        """
        Constructor.

        Non-wxPython related parameter:
          - datamax: the maximum value of the amplitude.
        """

        spControl.__init__(self, parent, id, pos, size)

        self.isselectable = False

        self._preferences = WavePreferences()
        self._datamax     = datamax
        self._wavedata    = []

        self._bggradientcolor = wx.Colour(180,190,180)

        # temporary
        self._bgcolor    = wx.WHITE
        self._bgpen      = wx.Pen(self._bgcolor, 1, wx.SOLID)
        self._bgbrush    = wx.Brush(self._bgcolor, wx.SOLID)

        self._fgcolor    = wx.Colour(10,60,10)
        self._fgpen      = wx.Pen(self._fgcolor, 1, wx.SOLID)
        self._fgbrush    = wx.Brush(self._fgcolor, wx.SOLID)

        self._handlescolor = wx.Colour(10,140,10)
        self._handlespen   = wx.Pen(self._handlescolor, 1, wx.SOLID)
        self._handlesbrush = wx.Brush(self._handlescolor, wx.SOLID)

        # disable margins (then handles)
        self._margins.Left  = 0
        self._margins.Right = 0
コード例 #9
0
    def __init__(self, parent, id=-1,
                 pos=wx.DefaultPosition,
                 size=wx.DefaultSize,
                 datamax=0):
        """
        Constructor.

        Non-wxPython related parameter:
          - datamax: the maximum value of the amplitude.
        """

        spControl.__init__(self, parent, id, pos, size)

        self.isselectable = False

        self._preferences = WavePreferences()
        self._datamax     = datamax
        self._wavedata    = []

        self._bggradientcolor = wx.Colour(180,190,180)

        # temporary
        self._bgcolor    = wx.WHITE
        self._bgpen      = wx.Pen(self._bgcolor, 1, wx.SOLID)
        self._bgbrush    = wx.Brush(self._bgcolor, wx.SOLID)

        self._fgcolor    = wx.Colour(10,60,10)
        self._fgpen      = wx.Pen(self._fgcolor, 1, wx.SOLID)
        self._fgbrush    = wx.Brush(self._fgcolor, wx.SOLID)

        self._handlescolor = wx.Colour(10,140,10)
        self._handlespen   = wx.Pen(self._handlescolor, 1, wx.SOLID)
        self._handlesbrush = wx.Brush(self._handlescolor, wx.SOLID)

        # disable margins (then handles)
        self._margins.Left  = 0
        self._margins.Right = 0
コード例 #10
0
    def __init__(self, parent, id=wx.ID_ANY,
                 pos=wx.DefaultPosition,
                 size=wx.DefaultSize,
                 trs=None):
        """ Constructor.

        Non-wxPython related parameter:
        :param trs: (Transcription) the object to display (see sppas.annodationdata)

        """
        # Members
        self._trs = trs
        self._tiers = None
        spControl.__init__(self, parent, id, pos, size)

        # Disable Pane (because each tier has its own pane)
        self._infopanep = wx.ALIGN_CENTRE

        # Members
        self._textalign = wx.ALIGN_CENTRE
        self._fontsizeauto = False

        # Transcription members
        self.__set(trs)