コード例 #1
0
ファイル: App.cs プロジェクト: haefele/SpotifyRecorder
        public App(ISpotifyService spotifyService, IAudioRecordingService recordingService, ISongWriter songWriter, IID3TagService id3TagService)
        {
            this._spotifyService = spotifyService;
            this._recordingService = recordingService;
            this._songWriter = songWriter;
            this._id3TagService = id3TagService;

            this._recordedSongs = new List<Song>();
        }
コード例 #2
0
ファイル: App.cs プロジェクト: haefele/SpotifyRecorder
        private void StopRecording(IAudioRecorder recorder, ISongWriter writer, IID3TagService id3TagService)
        {
            Task.Run(() =>
            {
                var recorded = recorder.StopRecording();

                if (recorded == null)
                    return;
                
                var tags = id3TagService.GetTags(recorded);
                tags.Artists = new[] { recorded.Song.Artist };
                tags.Title = recorded.Song.Title;
                tags.Album = recorded.Song.Album;

                id3TagService.UpdateTags(tags, recorded);

                if (writer.WriteSong(recorded))
                {
                    this._recordedSongs.Add(recorded.Song);
                    this.ReRenderScreen();
                }
            });
        }