C + + Builder manipulating multimedia databases

Source: Internet
Author: User

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:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.