Example #1
0
        internal VideoInfo(Interop.MediaInfoHandle handle) : base(handle)
        {
            IntPtr videoHandle = IntPtr.Zero;

            try
            {
                Interop.MediaInfo.GetVideo(handle, out videoHandle).ThrowIfError("Failed to retrieve data");

                Debug.Assert(videoHandle != IntPtr.Zero);

                Album        = InteropHelper.GetString(videoHandle, Interop.VideoInfo.GetAlbum);
                Artist       = InteropHelper.GetString(videoHandle, Interop.VideoInfo.GetArtist);
                AlbumArtist  = InteropHelper.GetString(videoHandle, Interop.VideoInfo.GetAlbumArtist);
                Genre        = InteropHelper.GetString(videoHandle, Interop.VideoInfo.GetGenre);
                Composer     = InteropHelper.GetString(videoHandle, Interop.VideoInfo.GetComposer);
                Year         = InteropHelper.GetString(videoHandle, Interop.VideoInfo.GetYear);
                DateRecorded = InteropHelper.GetString(videoHandle, Interop.VideoInfo.GetRecordedDate);
                Copyright    = InteropHelper.GetString(videoHandle, Interop.VideoInfo.GetCopyright);
                TrackNumber  = InteropHelper.GetString(videoHandle, Interop.VideoInfo.GetTrackNum);

                BitRate  = InteropHelper.GetValue <int>(videoHandle, Interop.VideoInfo.GetBitRate);
                Duration = InteropHelper.GetValue <int>(videoHandle, Interop.VideoInfo.GetDuration);
                Width    = InteropHelper.GetValue <int>(videoHandle, Interop.VideoInfo.GetWidth);
                Height   = InteropHelper.GetValue <int>(videoHandle, Interop.VideoInfo.GetHeight);
            }
            finally
            {
                Interop.VideoInfo.Destroy(videoHandle);
            }
        }
Example #2
0
        internal MediaInfo(Interop.MediaInfoHandle handle)
        {
            Id = InteropHelper.GetString(handle, Interop.MediaInfo.GetMediaId);

            Path        = InteropHelper.GetString(handle, Interop.MediaInfo.GetFilePath);
            DisplayName = InteropHelper.GetString(handle, Interop.MediaInfo.GetDisplayName);

            MediaType = InteropHelper.GetValue <MediaType>(handle, Interop.MediaInfo.GetMediaType);

            MimeType = InteropHelper.GetString(handle, Interop.MediaInfo.GetMimeType);

            FileSize = InteropHelper.GetValue <long>(handle, Interop.MediaInfo.GetSize);

            DateAdded    = InteropHelper.GetDateTime(handle, Interop.MediaInfo.GetAddedTime);
            DateModified = InteropHelper.GetDateTime(handle, Interop.MediaInfo.GetModifiedTime);
            Timeline     = InteropHelper.GetDateTime(handle, Interop.MediaInfo.GetTimeline);

            ThumbnailPath = InteropHelper.GetString(handle, Interop.MediaInfo.GetThumbnailPath, true);
            Description   = InteropHelper.GetString(handle, Interop.MediaInfo.GetDescription);

            Longitude = InteropHelper.GetValue <double>(handle, Interop.MediaInfo.GetLongitude);
            Latitude  = InteropHelper.GetValue <double>(handle, Interop.MediaInfo.GetLatitude);
            Altitude  = InteropHelper.GetValue <double>(handle, Interop.MediaInfo.GetAltitude);

            Rating     = InteropHelper.GetValue <int>(handle, Interop.MediaInfo.GetRating);
            IsFavorite = InteropHelper.GetValue <bool>(handle, Interop.MediaInfo.GetFavorite);
            Title      = InteropHelper.GetString(handle, Interop.MediaInfo.GetTitle);
            StorageId  = InteropHelper.GetString(handle, Interop.MediaInfo.GetStorageId);
            IsDrm      = InteropHelper.GetValue <bool>(handle, Interop.MediaInfo.IsDrm);

            StorageType = InteropHelper.GetValue <StorageType>(handle, Interop.MediaInfo.GetStorageType);
        }
Example #3
0
        internal Playlist(IntPtr handle)
        {
            Name          = InteropHelper.GetString(handle, Interop.Playlist.GetName);
            ThumbnailPath = InteropHelper.GetString(handle, Interop.Playlist.GetThumbnailPath);

            Id = InteropHelper.GetValue <IntPtr, int>(handle, Interop.Playlist.GetId);
        }
Example #4
0
        internal ImageInfo(Interop.MediaInfoHandle handle) : base(handle)
        {
            IntPtr imageHandle = IntPtr.Zero;

            try
            {
                Interop.MediaInfo.GetImage(handle, out imageHandle).ThrowIfError("Failed to retrieve data");

                Debug.Assert(imageHandle != IntPtr.Zero);

                Width  = InteropHelper.GetValue <int>(imageHandle, Interop.ImageInfo.GetWidth);
                Height = InteropHelper.GetValue <int>(imageHandle, Interop.ImageInfo.GetHeight);

                Orientation = InteropHelper.GetValue <Orientation>(imageHandle, Interop.ImageInfo.GetOrientation);

                DateTaken    = InteropHelper.GetString(imageHandle, Interop.ImageInfo.GetDateTaken);
                ExposureTime = InteropHelper.GetString(imageHandle, Interop.ImageInfo.GetExposureTime);

                FNumber = InteropHelper.GetValue <double>(imageHandle, Interop.ImageInfo.GetFNumber);
                Iso     = InteropHelper.GetValue <int>(imageHandle, Interop.ImageInfo.GetISO);

                Model = InteropHelper.GetString(imageHandle, Interop.ImageInfo.GetModel);
            }
            finally
            {
                Interop.ImageInfo.Destroy(imageHandle);
            }
        }
Example #5
0
 internal Bookmark(IntPtr handle)
 {
     Id            = InteropHelper.GetValue <int>(handle, Interop.Bookmark.GetId);
     ThumbnailPath = InteropHelper.GetString(handle, Interop.Bookmark.GetThumbnailPath);
     Offset        = InteropHelper.GetValue <int>(handle, Interop.Bookmark.GetMarkedTime);
     Name          = InteropHelper.GetString(handle, Interop.Bookmark.GetName);
 }
Example #6
0
        internal AudioInfo(Interop.MediaInfoHandle handle) : base(handle)
        {
            IntPtr audioHandle = IntPtr.Zero;

            try
            {
                Interop.MediaInfo.GetAudio(handle, out audioHandle).ThrowIfError("Failed to retrieve data");

                Debug.Assert(audioHandle != IntPtr.Zero);

                Album        = InteropHelper.GetString(audioHandle, Interop.AudioInfo.GetAlbum);
                Artist       = InteropHelper.GetString(audioHandle, Interop.AudioInfo.GetArtist);
                AlbumArtist  = InteropHelper.GetString(audioHandle, Interop.AudioInfo.GetAlbumArtist);
                Genre        = InteropHelper.GetString(audioHandle, Interop.AudioInfo.GetGenre);
                Composer     = InteropHelper.GetString(audioHandle, Interop.AudioInfo.GetComposer);
                Year         = InteropHelper.GetString(audioHandle, Interop.AudioInfo.GetYear);
                DateRecorded = InteropHelper.GetString(audioHandle, Interop.AudioInfo.GetRecordedDate);
                Copyright    = InteropHelper.GetString(audioHandle, Interop.AudioInfo.GetCopyright);
                TrackNumber  = InteropHelper.GetString(audioHandle, Interop.AudioInfo.GetTrackNum);

                BitRate      = InteropHelper.GetValue <int>(audioHandle, Interop.AudioInfo.GetBitRate);
                BitPerSample = InteropHelper.GetValue <int>(audioHandle, Interop.AudioInfo.GetBitPerSample);
                SampleRate   = InteropHelper.GetValue <int>(audioHandle, Interop.AudioInfo.GetSampleRate);
                Channels     = InteropHelper.GetValue <int>(audioHandle, Interop.AudioInfo.GetChannel);

                Duration = InteropHelper.GetValue <int>(audioHandle, Interop.AudioInfo.GetDuration);
            }
            finally
            {
                Interop.AudioInfo.Destroy(audioHandle);
            }
        }
Example #7
0
        internal Album(IntPtr handle)
        {
            Id = InteropHelper.GetValue <int>(handle, Interop.Album.GetId);

            Artist       = InteropHelper.GetString(handle, Interop.Album.GetArtist);
            AlbumArtPath = InteropHelper.GetString(handle, Interop.Album.GetAlbumArt);
            Name         = InteropHelper.GetString(handle, Interop.Album.GetName);
        }
Example #8
0
        internal Folder(IntPtr handle)
        {
            Id   = InteropHelper.GetString(handle, Interop.Folder.GetFolderId);
            Path = InteropHelper.GetString(handle, Interop.Folder.GetPath);
            Name = InteropHelper.GetString(handle, Interop.Folder.GetName);

            StorageType = InteropHelper.GetValue <StorageType>(handle, Interop.Folder.GetStorageType);
            StorageId   = InteropHelper.GetString(handle, Interop.Folder.GetStorageId);
        }
Example #9
0
        internal FaceInfo(IntPtr handle)
        {
            Id          = InteropHelper.GetString(handle, Interop.Face.GetId);
            MediaInfoId = InteropHelper.GetString(handle, Interop.Face.GetMediaId);

            Tag         = InteropHelper.GetString(handle, Interop.Face.GetTag);
            Orientation = InteropHelper.GetValue <IntPtr, Orientation>(handle, Interop.Face.GetOrientation);

            Rect = GetRect(handle);
        }
Example #10
0
        internal BookInfo(Interop.MediaInfoHandle handle) : base(handle)
        {
            IntPtr bookHandle = IntPtr.Zero;

            try
            {
                Interop.MediaInfo.GetBook(handle, out bookHandle).ThrowIfError("Failed to retrieve data");

                Debug.Assert(bookHandle != IntPtr.Zero);

                Subject       = InteropHelper.GetString(bookHandle, Interop.BookInfo.GetSubject);
                Author        = InteropHelper.GetString(bookHandle, Interop.BookInfo.GetAuthor);
                DatePublished = InteropHelper.GetString(bookHandle, Interop.BookInfo.GetDate);
                Publisher     = InteropHelper.GetString(bookHandle, Interop.BookInfo.GetPublisher);
            }
            finally
            {
                Interop.BookInfo.Destroy(bookHandle).ThrowIfError("Failed to destroy book handle");
            }
        }
Example #11
0
 internal Tag(IntPtr handle)
 {
     Name = InteropHelper.GetString(handle, Interop.Tag.GetName);
     Id   = InteropHelper.GetValue <int>(handle, Interop.Tag.GetId);
 }
Example #12
0
 internal Storage(IntPtr handle)
 {
     Path = InteropHelper.GetString(handle, Interop.Storage.GetPath);
     Id   = InteropHelper.GetString(handle, Interop.Storage.GetId);
     Type = InteropHelper.GetValue <StorageType>(handle, Interop.Storage.GetType);
 }