With the development of computer software and hardware technology, the processing ability of multimedia information is enhanced, and the powerful database development function of fast development tool C + + Builder makes the control of creating, saving, fetching, displaying and playback of multimedia data (library) easy to realize. This paper will build a database with 5 fields "number, name, photograph, sound, activity image" as an example, according to whether the multimedia data and the database itself are stored together, introduce two kinds of multimedia database processing method, here is called the integration method and the separation method.
Integration method
This method is to store the multimedia data directly in the database, the "number" and "Name" Fields are ftstring field types, the "Photo" field uses the Ftgraphic field type for BMP files, both the sound and active image fields are Ftblob field types (Other formats Multimedia files can be used in this binary type storage, respectively, for storing WAV and AVI files, such a database structure can be used in C + + Builder provided by the "database Desktop" created, can also be created with the following code:
Ttable *newtable = new Ttable (this);
Newtable->active = false;
newtable->databasename = "E:\\mydata";
newtable->tablename = "example1.db";
newtable->tabletype = Ttparadox;
Defining data Table Types
newtable->fielddefs->clear ();
Newtable->fielddefs->add ("number", ftstring,8,false);//define field, type, length, etc.
Newtable->fielddefs->add ("name", ftstring,8, false);
Newtable->fielddefs->add ("Photo", Ftgraphic,0,false);
Newtable->fielddefs->add ("Voice", Ftblob,0,false);
Newtable->fielddefs->add ("Digital Cinema", ftblob,0,false);
newtable->createtable ();//Create Datasheet
Delete newtable;
Because you want to programmatically implement the ability to add records to a database, it is assumed that the database program design phase datasheet example1
。 DB has been built, assuming that the required multimedia files are stored under the E: \mydata\media path.
The functional interface of the program you want to complete is shown in Figure 1:
Figure 1 Operation interface
Clicking on the "Open Database" button opens the library file example1.db and displays the appropriate information for the original record. Click on the "Add Record" button will append new records, through the data navigation button to record the movement, modify, and so on, at each moment, click the "Listen to audible" button can hear the corresponding sound of the current record, click the "See Shadow" button to see the current record corresponding to the active image. This application already has a multimedia database application system basic function, the following is the main design steps: