Exemple #1
0
        public void PlayPlayList(CS_PlayList pls)
        {
            Hyena.Log.Information("Playing playlist " + pls.PlsName);
            CueSheet s = pls.GetCueSheet();

            loadCueSheet(s);
        }
Exemple #2
0
        public CS_PlayListAdmin(CS_PlayListsView plsview, CS_PlayListsModel mdl, CS_PlayListCollection cl)
        {
            _col   = cl;
            _model = mdl;
            Gtk.HBox hb = new Gtk.HBox();

            Gtk.Button _add = new Gtk.Button(Gtk.Stock.Add);
            _add.Clicked += delegate(object sender, EventArgs args) {
                OnAddPls();
            };

            Gtk.Button _remove = new Gtk.Button(Gtk.Stock.Remove);
            _remove.Clicked += delegate(object sender, EventArgs args) {
                OnRemovePls();
            };

            hb.PackStart(_add);
            hb.PackStart(_remove);

            plsscroll = new Gtk.ScrolledWindow();
            plsscroll.Add(plsview);

            _pls       = null;
            _pls_name  = new Gtk.Entry();
            _pls_model = new CS_PlayListModel();
            _pls_view  = new CS_PlayListView();
            _pls_view.SetModel(_pls_model);
            plscroll = new Gtk.ScrolledWindow();
            plscroll.Add(_pls_view);

            _pls_view.DragEnd += delegate(object sender, DragEndArgs args) {
                Console.WriteLine(args);
            };
            Gtk.VBox plsvbox = new Gtk.VBox();
            plsvbox.PackStart(_pls_name, false, false, 2);
            plsvbox.PackEnd(plscroll);

            Gtk.VPaned vpn = new Gtk.VPaned();
            vpn.Add1(plsscroll);
            vpn.Add2(plsvbox);

            base.PackStart(hb, false, false, 2);
            base.PackEnd(vpn);

            base.ShowAll();

            mdl.SetListener(delegate(CS_PlayList pls) {
                _pls = pls;
                _pls_model.SetPlayList(_pls);
                _pls_name.Text = _pls.PlsName;
            });
        }
Exemple #3
0
 protected override bool OnDragDrop(Gdk.DragContext drg, int x, int y, uint time)
 {
     Gtk.Widget w = Gtk.Drag.GetSourceWidget(drg);
     if (w is CS_TrackListView)
     {
         CS_TrackListView v     = (CS_TrackListView)w;
         CS_PlayListModel model = (CS_PlayListModel)this.Model;
         CS_PlayList      pls   = model.PlayList;
         if (pls != null)
         {
             List <CueSheetEntry> l = v.DragData;
             foreach (CueSheetEntry e in l)
             {
                 pls.Add(e);
             }
             model.Reload();
             pls.Save();
         }
     }
     return(false);
 }
Exemple #4
0
        public void OnAddPls()
        {
            Hyena.Log.Information("add playlist");
            Gtk.Dialog dlg = new Gtk.Dialog();
            dlg.Title = "Add Playlist";
            Gtk.Entry pls = new Gtk.Entry();
            pls.WidthChars = 40;
            Gtk.Label lbl = new Gtk.Label("Playlist name:");
            Gtk.HBox  hb  = new Gtk.HBox();
            hb.PackStart(lbl, false, false, 1);
            hb.PackEnd(pls);
            dlg.VBox.PackStart(hb);
            dlg.AddButton(Gtk.Stock.Cancel, 0);
            dlg.AddButton(Gtk.Stock.Ok, 1);
            dlg.VBox.ShowAll();
            string plsname = "";

            while (plsname == "")
            {
                int response = dlg.Run();
                if (response == 0)
                {
                    dlg.Hide();
                    dlg.Destroy();
                    return;
                }
                else
                {
                    plsname = pls.Text.Trim();
                }
            }
            dlg.Hide();
            dlg.Destroy();
            _pls = _col.NewPlayList(plsname);
            _model.Reload();
            _pls_model.SetPlayList(_pls);
        }
Exemple #5
0
 public void SetPlayList(CS_PlayList pls)
 {
     _pls = pls;
     Reload();
 }
Exemple #6
0
 public CS_PlayListModel()
 {
     _pls      = null;
     Selection = new Hyena.Collections.Selection();
 }