Recognizes if input is ogg or not.
[xiph.git] / xinloe / infobox.py
blobe2882b80a282d7b50aad31e2ee46b535c442f220
1 '''
2 Xinloe -- A Python-Based Non-Linear Ogg Editor
3 Copyright (C) 2004 Arc Riley <arc@Xiph.org>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 '''
21 from general import *
23 class InfoboxPanel(wxScrolledPanel):
24 def __init__(self, parent):
25 wxScrolledPanel.__init__(self, parent, -1)
26 self.infowin = InfoboxScrolledPanel(self)
27 self.topsizer = wxBoxSizer(wxVERTICAL)
28 self.topsizer.Add(self.infowin, 1, wxEXPAND, 0)
29 self.SetSizer(self.topsizer)
30 self.SetupScrolling(scroll_x=False)
31 self.SetAutoLayout(1)
33 def ShowCodec(self, handler):
34 self.topsizer.Remove(self.infowin)
35 self.infowin.Destroy()
36 self.infowin = InfoboxScrolledPanel(self)
37 self.topsizer.Add(self.infowin, 1, wxEXPAND, 0)
39 bmp = geticon(handler.icon,3)
40 logo = wxStaticBitmap(self.infowin, -1, bmp, wxPoint(16, 16),
41 wxSize(bmp.GetWidth(), bmp.GetHeight()))
42 title = gettext(self.infowin, ' %s - %s '%(handler.name, handler.desc), 5)
43 general = gettext(self.infowin, '%s %s (%s)' % (timestr(handler.length),
44 ratestr(handler.bytes, handler.length),
45 bytestr(handler.bytes)), 3)
47 topbox = wxBoxSizer(wxHORIZONTAL)
48 topbox.Add(logo, 0, wxALIGN_LEFT, 4)
49 titlebox = wxBoxSizer(wxVERTICAL)
50 titlebox.Add(title, 0, wxALIGN_LEFT, 4)
51 titlebox.Add(general, 0, wxALIGN_CENTER, 4)
52 topbox.AddSizer(titlebox, 0)
53 infobox = wxBoxSizer(wxVERTICAL)
54 infobox.AddSizer(topbox, 0)
55 self.infowin.SetAutoLayout(1)
56 self.infowin.SetSizer(infobox)
57 self.topsizer.Layout()
59 class InfoboxScrolledPanel(wxWindow, wxPanel):
60 def __init__(self, parent):
61 wxPanel.__init__(self, parent, -1)
62 self.SetBackgroundColour('White')
63 self.SetAutoLayout(1)