banshee r4589 - in trunk/banshee: . src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor src/Extensions/Banshee.AudioCd/Banshee.AudioCd
- From: abock svn gnome org
- To: svn-commits-list gnome org
- Subject: banshee r4589 - in trunk/banshee: . src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor src/Extensions/Banshee.AudioCd/Banshee.AudioCd
- Date: Mon, 22 Sep 2008 20:10:54 +0000 (UTC)
Author: abock
Date: Mon Sep 22 20:10:54 2008
New Revision: 4589
URL: http://svn.gnome.org/viewvc/banshee?rev=4589&view=rev
Log:
2008-09-22 Aaron Bockover <abock gnome org>
* src/Extensions/Banshee.AudioCd/Banshee.AudioCd/AudioCdDiscModel.cs:
Compute the PCM file size for each track, set it on AudioCdTrackInfo,
and aggregate these values into a disc size
* src/Extensions/Banshee.AudioCd/Banshee.AudioCd/AudioCdSource.cs:
Implement IFileSizeAggregator and report the disc size
* src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/EditorTrackInfo.cs:
Only dump the taglib read exception if the URI scheme is file
* src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/TrackEditorDialog.cs:
Show either an Editor or Properties title based on the editor mode
Modified:
trunk/banshee/ChangeLog
trunk/banshee/configure.ac
trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/EditorTrackInfo.cs
trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/TrackEditorDialog.cs
trunk/banshee/src/Extensions/Banshee.AudioCd/Banshee.AudioCd/AudioCdDiscModel.cs
trunk/banshee/src/Extensions/Banshee.AudioCd/Banshee.AudioCd/AudioCdSource.cs
Modified: trunk/banshee/configure.ac
==============================================================================
--- trunk/banshee/configure.ac (original)
+++ trunk/banshee/configure.ac Mon Sep 22 20:10:54 2008
@@ -232,6 +232,7 @@
if test "x$enable_torrent" = "xyes"; then echo " Torrent Podcasts: ${enable_torrent}"; fi
if test -d ${expanded_libdir}/${PACKAGE}; then
+ echo
echo "WARNING: An existing Banshee install is in ${expanded_libdir}/${PACKAGE}"
echo " Remove the existing install before installing this build."
echo " Installing over an existing install will cause conflicts!"
Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/EditorTrackInfo.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/EditorTrackInfo.cs (original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/EditorTrackInfo.cs Mon Sep 22 20:10:54 2008
@@ -82,7 +82,9 @@
return taglib_file;
}
} catch (Exception e) {
- Hyena.Log.Exception ("Cannot load TagLib file", e);
+ if (Uri.Scheme == "file") {
+ Hyena.Log.Exception ("Cannot load TagLib file", e);
+ }
}
taglib_file_exists = false;
Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/TrackEditorDialog.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/TrackEditorDialog.cs (original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/TrackEditorDialog.cs Mon Sep 22 20:10:54 2008
@@ -91,7 +91,8 @@
public event EventHandler Navigated;
- private TrackEditorDialog (TrackListModel model, EditorMode mode) : base (Catalog.GetString ("Track Editor"))
+ private TrackEditorDialog (TrackListModel model, EditorMode mode) : base (
+ mode == EditorMode.Edit ? Catalog.GetString ("Track Editor") : Catalog.GetString ("Track Properties"))
{
this.mode = mode;
Modified: trunk/banshee/src/Extensions/Banshee.AudioCd/Banshee.AudioCd/AudioCdDiscModel.cs
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.AudioCd/Banshee.AudioCd/AudioCdDiscModel.cs (original)
+++ trunk/banshee/src/Extensions/Banshee.AudioCd/Banshee.AudioCd/AudioCdDiscModel.cs Mon Sep 22 20:10:54 2008
@@ -44,6 +44,9 @@
{
public class AudioCdDiscModel : MemoryTrackListModel
{
+ // 44.1 kHz sample rate * 16 bit channel resolution * 2 channels (stereo)
+ private const long PCM_FACTOR = 176400;
+
private IDiscVolume volume;
public event EventHandler MetadataQueryStarted;
@@ -62,6 +65,11 @@
get { return duration; }
}
+ private long file_size;
+ public long FileSize {
+ get { return file_size; }
+ }
+
public AudioCdDiscModel (IDiscVolume volume)
{
this.volume = volume;
@@ -85,10 +93,12 @@
track.Duration = TimeSpan.FromSeconds (mb_disc.TrackDurations[i]);
track.ArtistName = Catalog.GetString ("Unknown Artist");
track.AlbumTitle = Catalog.GetString ("Unknown Album");
- track.TrackTitle = String.Format(Catalog.GetString ("Track {0}"), track.TrackNumber);
+ track.TrackTitle = String.Format (Catalog.GetString ("Track {0}"), track.TrackNumber);
+ track.FileSize = mb_disc.TrackDurations[i] * PCM_FACTOR;
Add (track);
duration += track.Duration;
+ file_size += track.FileSize;
}
EnabledCount = Count;
Modified: trunk/banshee/src/Extensions/Banshee.AudioCd/Banshee.AudioCd/AudioCdSource.cs
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.AudioCd/Banshee.AudioCd/AudioCdSource.cs (original)
+++ trunk/banshee/src/Extensions/Banshee.AudioCd/Banshee.AudioCd/AudioCdSource.cs Mon Sep 22 20:10:54 2008
@@ -43,7 +43,8 @@
namespace Banshee.AudioCd
{
- public class AudioCdSource : Source, ITrackModelSource, IUnmapableSource, IDurationAggregator, IDisposable
+ public class AudioCdSource : Source, ITrackModelSource, IUnmapableSource,
+ IDurationAggregator, IFileSizeAggregator, IDisposable
{
private AudioCdService service;
private AudioCdDiscModel disc_model;
@@ -77,6 +78,10 @@
get { return disc_model.Duration; }
}
+ public long FileSize {
+ get { return disc_model.FileSize; }
+ }
+
public bool DiscIsPlaying {
get {
AudioCdTrackInfo playing_track = ServiceManager.PlayerEngine.CurrentTrack as AudioCdTrackInfo;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]