Esempio n. 1
0
 public AddSong(Controller c, AddAlbum parent)
 {
     _controller = c;
     _isEdit = false;
     _parent = parent;
     InitializeComponent();
     this.removeSong.Visible = false;
 }
Esempio n. 2
0
 public AddSong(Controller c, AddAlbum parent, string name, string length)
     : this(c, parent)
 {
     _isEdit = true;
     this.Text = "Edit Song";
     this.removeSong.Visible = true;
     this.lengthBox.Text = length;
     this.nameBox.Text = name;
 }
Esempio n. 3
0
        public SongRow(Controller c, Song s, Album a, AddAlbum view)
        {
            _controller = c;
            _model = s;
            _parent = a;
            _view = view;

            InitializeComponent();

            this.songName.Text = _model.getName();
            this.lengthLabel.Text = parseTime(_model.getlength());
        }
Esempio n. 4
0
        internal bool saveSong(AddSong addSong, string name, string length, bool isEdit, AddAlbum view)
        {
            if (name.Length == 0)
            {
                showMessage(true, "Song must have a name");
                return false;
            }
            else if (length.Length == 0)
            {
                showMessage(true, "Song must have a length");
                return false;
            }
            else if (!length.StartsWith("PT"))
            {
                showMessage(true, "Song length must be of format: PT##M##S");
                return false;
            }

            if (SongRow.parseTime(length).Equals("ERROR"))
            {
                showMessage(true, "Song length must be of format: PT##M##S");
                return false;
            }

            if (isEdit)
            {
                songHighlight.setName(name);
                songHighlight.setLength(length);
            }
            else
            {
                Song s = new Song();
                s.setName(name);
                s.setLength(length);
                addingSongs.Add(s);
                songHighlight = s;
            }

            List<Song> temp = new List<Song>();
            temp.AddRange(albumHighlight.getSongs());
            if(addingSongs != null)
                temp.AddRange(addingSongs);

            view.addSongRows(temp.ToArray());

            return true;
        }
Esempio n. 5
0
        internal void removeSong(AddAlbum view)
        {
            if(addingSongs != null)
                addingSongs.Remove(songHighlight);
            albumHighlight.removeSong(songHighlight);

            List<Song> temp = new List<Song>();
            temp.AddRange(albumHighlight.getSongs());
            if(addingSongs != null)
                temp.AddRange(addingSongs);

            view.addSongRows(temp.ToArray());

            //Disable buttons
            view.disableEdit();
        }
Esempio n. 6
0
        internal bool saveAlbum(AddAlbum addAlbum, bool isEdit, string name)
        {
            if (addingSongs != null)
            {
                if (addingSongs.Count == 0)
                {
                    showMessage(true, "Must have at least one song");
                    return false;
                }
                foreach (Song s in addingSongs)
                    albumHighlight.addSong(s);
                addingSongs = new List<Song>();
            }
            else
            {
                showMessage(true, "Must have at least one song");
                return false;
            }

            albumHighlight.setName(name);

            if(!isEdit)
                bandHighlight.addAlbum(albumHighlight);

            //DISABLE album buttons
            ((MainView)_current_view).disableEdit(MainView.BAND_TAB_ALBUM);
            ((MainView)_current_view).disableDelete(MainView.BAND_TAB_ALBUM);
            ((MainView)_current_view).disableAddReview();

            ((MainView)_current_view).initializeBandTab(bandHighlight);

            saveXML();

            return true;
        }
Esempio n. 7
0
 internal void editSong(AddAlbum addAlbum)
 {
     AddSong addSongView = new AddSong(this, addAlbum, songHighlight.getName(), songHighlight.getlength());
     addSongView.Show();
 }
Esempio n. 8
0
 internal void editAlbum()
 {
     AddAlbum addAlbumView = new AddAlbum(this, albumHighlight, null);
     addAlbumView.Show();
 }
Esempio n. 9
0
 internal void addSong(AddAlbum addAlbum)
 {
     AddSong addSongView = new AddSong(this, addAlbum);
     addSongView.Show();
     addingSongs = new List<Song>();
 }
Esempio n. 10
0
 internal void addAlbum()
 {
     albumHighlight = new Album("No Name");
     AddAlbum addAlbumView = new AddAlbum(this, albumHighlight, null);
     addAlbumView.Show();
 }
Esempio n. 11
0
        public void songClick(SongRow row, Song s, Album a, AddAlbum view)
        {
            foreach(SongRow srow in view.getSongRows())
                srow.setNormal();
            row.setGreen();

            songHighlight = s;

            view.enableEdit();
        }