1. Technical Field
The disclosure generally relates to a system and method for generating a collection of media files in an electronic device.
2. Description of Related Art
Computer users often store music, movies, and other media files on their computers. By so doing, users can later play and record their music without having to get another copy. But filing systems in many computers are not geared to allow users to easily view and use their media files. Often users have to manually add or delete links to media files in a play list or a media library when the users add or delete media files stored in their computers. Therefore there is room for improvement in media management.
Many aspects of the embodiments can be better understood with reference to the following drawings. The components in the drawings are not necessarily drawn to scale, the emphasis instead being placed upon clearly illustrating the principles of the embodiments. Moreover, in the drawings, like reference numerals designate corresponding parts throughout the several views.
The disclosure is illustrated by way of example and not by way of limitation in the figures of the accompanying drawings in which like references indicate similar elements. It should be noted that references to “an” or “one” embodiment in this disclosure are not necessarily to the same embodiment, and such references mean at least one.
In general, the word “module”, as used herein, refers to logic embodied in hardware or firmware, or to a collection of software instructions, written in a programming language, such as, Java, C, or Assembly. One or more software instructions in the modules may be embedded in firmware, such as EPROM. The modules described herein may be implemented as either software and/or hardware modules and may be stored in any type of non-transitory computer-readable medium or other storage device. Some non-limiting examples of non-transitory computer-readable media include CDs, DVDs, BLU-RAY, flash memory, and hard disk drives.
In one embodiment, the storage system 110 may be a magnetic or an optical storage system, such as a hard disk drive, an optical drive, or a tape drive. The storage system 110 may store media files. The network adapter 130 may be a network interface card using a specific physical layer and data link layer standard such Ethernet or Wi-Fi. The network 30 may be a local area network (LAN) or a wide area network (WAN), such as the Internet.
An external storage device 140 may be connected to the electronic device 10. The external storage device 140 may store media files. The external storage device 140 may be an external hard disk drive, a compact flash card, or a floppy disk drive.
The location module 101 may record and specify one or more locations where media files are stored. The location module 101 may point to a local folder of the storage system 110, for example, “D:\music\”. The location may also point to a remote location in the media server 20 and refer to a specific protocol. For example, the location may point to a location of the media server 20 “ftp://10.0.0.20/music/”. The media files may include audio files, video files, and image files.
The scanning module 102 may scan the media files in the one or more locations. The scanning module 102 may scan the extension names of all files in the one or more locations. When the extension name of a file meets the extension name criteria of media files generally, the scanning module 102 will determine that that file is a media file. Media files of a media type always have one or more specific extension names. For example, in general the extension name of a JPEG file is “.jpg” or “.jpeg”. In
The collection generator 103 may generate a collection of the media files. The collection generator 103 may organize the media files by their title, by artist, by album name, by genre, or by rating in the collection.
The verifying module 104 may verify whether the media files in the collection are valid or not. A media file of a media type has a specific series of bytes called feature codes in its data. In
In order to verify the media files in the collection, the verifying module 104 may read a plurality of bytes from data of a media file in the collection and check whether the plurality of bytes meets the feature codes criteria of media files. When the plurality of bytes does meet the feature codes criteria, the verifying module 104 may determine the media file as a valid media file. When the plurality of bytes does not meet any one of the feature codes criteria of media files, the verifying module 104 may determine the media file to be an invalid media file and delete the media file from the collection created by the generator 103 of this embodiment.
The first processing module 105 may monitor a hardware installation event. When the first processing module 105 detects an installation of the external storage device 140, the processing module 105 may scan media files in the external storage device 140 and add the media files, scanned in the external storage device 140, to the collection.
The second processing module 106 may monitor a hardware uninstallation event. When the second processing module 106 detects an uninstallation of the external storage device 140, the second processing module 106 may determine all media files out of all the files in the external storage device 140 and delete the particular media files located in the external storage device 140 from the collection.
In step S301, the location module 101 records and specifies one or more locations where media files are stored.
In step S302, the scanning module 102 scans the media files in the one or more locations.
In step S303, the collection generator 103 generates a collection of the media files.
In step S304, the verifying module 104 verifies whether all or any of the media files in the collection are valid or not. When a media file is determined to be invalid, the verifying module 104 deletes the media file from the collection.
In step S401, the first processing module 105 detects an installation of the external storage device 140.
In step S402, the processing module 105 scans media files in the external storage device 140.
In step S403, the processing module 105 adds the media files, scanned in the external storage device 140, to the collection.
In step S501, the second processing module 106 detects an uninstallation of the external storage device 140.
In step S502, the second processing module 106 determines all files in the external storage device 140 which are media files, out of all the files in the external storage device 140.
In step S503, the second processing module 106 deletes all media files which are located in the external storage device 140 from the collection.
It is to be understood, however, that even though numerous characteristics and advantages have been set forth in the foregoing description of embodiments, together with details of the structures and functions of the embodiments, the disclosure is illustrative only and changes may be made in detail, especially in matters of shape, size, and arrangement of parts within the principles of the disclosure to the full extent indicated by the broad general meaning of the terms in which the appended claims are expressed.
Depending on the embodiment, certain steps or methods described may be removed, others may be added, and the sequence of steps may be altered. It is also to be understood that the description and the claims drawn for or in relation to a method may include some indication in reference to certain steps. However, any indication used is only to be viewed for identification purposes and not as a suggestion as to an order for the steps.
Number | Date | Country | Kind |
---|---|---|---|
99139289 | Nov 2010 | TW | national |