Exemplo n.º 1
0
        public MainWindow()
        {
            InitializeComponent();

            this.Width       = Core.Util.Preferences.Default.MainWidth;
            this.Height      = Core.Util.Preferences.Default.MainHeight;
            this.WindowState = Core.Util.Preferences.Default.MainMaximized ? WindowState.Maximized : WindowState.Normal;

            ThemeManager.LoadTheme(); // TODO : move to program entry point

            progVM = this.Resources["progVM"] as ProgressBarViewModel;
            progVM.Subscribe(DocManager.Inst);
            progVM.Foreground = ThemeManager.NoteFillBrushes[0];

            this.CloseButtonClicked           += (o, e) => { CmdExit(); };
            CompositionTargetEx.FrameUpdating += RenderLoop;

            viewScaler.Max   = UIConstants.TrackMaxHeight;
            viewScaler.Min   = UIConstants.TrackMinHeight;
            viewScaler.Value = UIConstants.TrackDefaultHeight;

            trackVM = this.Resources["tracksVM"] as TracksViewModel;
            trackVM.TimelineCanvas = this.timelineCanvas;
            trackVM.TrackCanvas    = this.trackCanvas;
            trackVM.HeaderCanvas   = this.headerCanvas;
            trackVM.Subscribe(DocManager.Inst);

            CmdNewFile();

            initialized = true;
        }
 public TrackListControl(TracksViewModel vm)
 {
     InitializeComponent();
     DataContext = this;
     this.vm     = vm;
     getTracks   = vm.GetTracks;
     PlaybackControl.ShuffleAll += vm.ShuffleAll;
 }
Exemplo n.º 3
0
        protected SwitchingPage(TrackListControl trackListControl, AlbumListControl albumListControl,
                                ArtistListControl artistListControl, TracksViewModel viewModel)
        {
            InitializeComponent();
            TrackListControl  = trackListControl;
            AlbumListControl  = albumListControl;
            ArtistListControl = artistListControl;
            ViewModel         = viewModel;

            ViewFrame.Content = CurrentControl = trackListControl;
        }
Exemplo n.º 4
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            if (isNewInstance)
            {
                viewModel = new TracksViewModel();
                viewModel.Load();
                DataContext = viewModel;
            }
            isNewInstance = false;
        }
Exemplo n.º 5
0
        public WaveDesignerViewModel(
            FileHelper fileHelper,
            WaveBuilderHelper waveBuilderHelper,
            TreeViewModel treeDesigner,
            TracksViewModel tracks)
        {
            _fileHelper        = fileHelper;
            _waveBuilderHelper = waveBuilderHelper;

            TreeDesigner = treeDesigner;
            Tracks       = tracks;
        }
Exemplo n.º 6
0
        public HttpResponse Create(string albumId)
        {
            if (!this.IsUserLoggedIn())
            {
                return(this.Redirect("/Users/Login"));
            }

            var viewModel = new TracksViewModel()
            {
                AlbumId = albumId
            };

            return(this.View(viewModel));
        }
Exemplo n.º 7
0
        public TracksView(TrackListControl trackListControl, AlbumListControl albumListControl,
                          ArtistListControl artistListControl, TracksViewModel viewModel)
            : base(trackListControl, albumListControl, artistListControl, viewModel)
        {
            this.trackListControl  = trackListControl;
            this.albumListControl  = albumListControl;
            this.artistListControl = artistListControl;

            albumListControl.ToTracksByAlbum   += OnToTracksByAlbum;
            artistListControl.ToAlbumsByArtist += OnToAlbumsByArtist;
            trackListControl.ToAlbum           += OnToTracksByAlbum;
            trackListControl.ToArtist          += OnToAlbumsByArtist;

            Refresh();
        }
        public IActionResult Details()
        {
            Track track = this.trackService.GetTrackById(this.Request.QueryData["trackId"].ToString());

            if (track == null)
            {
                this.ViewModel.Data["Error"] = "No such track.";
            }
            TracksViewModel tracksViewModel = new TracksViewModel {
                Name        = track.Name,
                Price       = track.Price,
                TrackSource = track.Link,
                AlbumId     = this.Request.QueryData["albumId"].ToString()
            };

            this.ViewModel.Data["TracksViewModel"] = tracksViewModel;
            return(this.View());
        }
Exemplo n.º 9
0
        public MainWindow()
        {
            InitializeComponent();

            this.Width       = Core.Util.Preferences.Default.MainWidth;
            this.Height      = Core.Util.Preferences.Default.MainHeight;
            this.WindowState = Core.Util.Preferences.Default.MainMaximized ? WindowState.Maximized : WindowState.Normal;

            ThemeManager.LoadTheme(); // TODO : move to program entry point

            progVM = this.Resources["progVM"] as ProgressBarViewModel;
            progVM.Subscribe(DocManager.Inst);
            progVM.Foreground = ThemeManager.NoteFillBrushes[0];

            this.CloseButtonClicked           += (o, e) => { CmdExit(); };
            CompositionTargetEx.FrameUpdating += RenderLoop;

            viewScaler.Max   = UIConstants.TrackMaxHeight;
            viewScaler.Min   = UIConstants.TrackMinHeight;
            viewScaler.Value = UIConstants.TrackDefaultHeight;

            trackVM = this.Resources["tracksVM"] as TracksViewModel;
            trackVM.TimelineCanvas = this.timelineCanvas;
            trackVM.TrackCanvas    = this.trackCanvas;
            trackVM.HeaderCanvas   = this.headerCanvas;
            trackVM.Subscribe(DocManager.Inst);

            CmdNewFile();

            if (UpdateChecker.Check())
            {
                var menuItem = new MenuItem()
                {
                    Header     = (string)FindResource("menu.updateavail"),
                    Foreground = ThemeManager.WhiteKeyNameBrushNormal,
                };
                menuItem.Click += (sender, e) => {
                    System.Diagnostics.Process.Start("https://github.com/stakira/OpenUtau");
                };

                mainMenu.Items.Add(menuItem);
            }
        }
Exemplo n.º 10
0
        public ActionResult Details(int id)
        {
            var             tracks = TrackManager.RetrieveTracks(id);
            TracksViewModel model  = new TracksViewModel()
            {
                Tracks = new List <TrackViewModel>()
            };

            foreach (var track in tracks)
            {
                model.Tracks.Add(new TrackViewModel()
                {
                    ActivityName = track.ActivityName,
                    EventTime    = track.EventTime,
                    State        = track.State
                });
            }
            return(View(model));
        }
Exemplo n.º 11
0
        public MainWindow()
        {
            InitializeComponent();

            this.Width = Core.Util.Preferences.Default.MainWidth;
            this.Height = Core.Util.Preferences.Default.MainHeight;
            this.WindowState = Core.Util.Preferences.Default.MainMaximized ? WindowState.Maximized : WindowState.Normal;

            ThemeManager.LoadTheme(); // TODO : move to program entry point

            progVM = this.Resources["progVM"] as ProgressBarViewModel;
            progVM.Subscribe(DocManager.Inst);
            progVM.Foreground = ThemeManager.NoteFillBrushes[0];

            this.CloseButtonClicked += (o, e) => { CmdExit(); };
            CompositionTargetEx.FrameUpdating += RenderLoop;

            viewScaler.Max = UIConstants.TrackMaxHeight;
            viewScaler.Min = UIConstants.TrackMinHeight;
            viewScaler.Value = UIConstants.TrackDefaultHeight;

            trackVM = this.Resources["tracksVM"] as TracksViewModel;
            trackVM.TimelineCanvas = this.timelineCanvas;
            trackVM.TrackCanvas = this.trackCanvas;
            trackVM.HeaderCanvas = this.headerCanvas;
            trackVM.Subscribe(DocManager.Inst);

            CmdNewFile();

            if (UpdateChecker.Check())
                this.mainMenu.Items.Add(new MenuItem()
                {
                    Header = @"Update available",
                    Foreground = ThemeManager.WhiteKeyNameBrushNormal
                });
        }
Exemplo n.º 12
0
 public LocalTracksView(TrackListControl trackListControl, AlbumListControl albumListControl,
                        ArtistListControl artistListControl, TracksViewModel viewModel, FileManager fm)
     : base(trackListControl, albumListControl, artistListControl, viewModel)
 {
     fm.FilesUploaded += (sender, args) => RefreshAll();
 }
Exemplo n.º 13
0
 public WavePlayerHelper(TracksViewModel tracks)
 {
     _tracks = tracks;
 }
Exemplo n.º 14
0
 private void UpdateArtistType()
 {
     FilterGroupings();
     TracksViewModel.UpdateTracks(_artistTypeTrack);
 }
Exemplo n.º 15
0
 private void TracksView_Loaded(object sender, RoutedEventArgs e)
 {
     _viewmodel = this.DataContext as TracksViewModel;
 }
Exemplo n.º 16
0
 public ArtistListControl(TracksViewModel vm)
 {
     InitializeComponent();
     DataContext = this;
     getArtists  = vm.GetArtists;
 }
 public CloudTracksView(TrackListControl trackListControl, AlbumListControl albumListControl,
                        ArtistListControl artistListControl, TracksViewModel vm)
     : base(trackListControl, albumListControl, artistListControl, vm)
 {
 }