CN104460997B - A kind of method and terminal for realizing music switching - Google Patents
A kind of method and terminal for realizing music switching Download PDFInfo
- Publication number
- CN104460997B CN104460997B CN201410712584.5A CN201410712584A CN104460997B CN 104460997 B CN104460997 B CN 104460997B CN 201410712584 A CN201410712584 A CN 201410712584A CN 104460997 B CN104460997 B CN 104460997B
- Authority
- CN
- China
- Prior art keywords
- music
- axis
- rotation
- preset coordinate
- terminal
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/03—Arrangements for converting the position or the displacement of a member into a coded form
- G06F3/033—Pointing devices displaced or positioned by the user, e.g. mice, trackballs, pens or joysticks; Accessories therefor
- G06F3/0346—Pointing devices displaced or positioned by the user, e.g. mice, trackballs, pens or joysticks; Accessories therefor with detection of the device orientation or free movement in a 3D space, e.g. 3D mice, 6-DOF [six degrees of freedom] pointers using gyroscopes, accelerometers or tilt-sensors
Abstract
The embodiment of the invention discloses a kind of method and terminal for realizing music switching, this method includes:The rotary speed of terminal is detected, rotary speed includes angular velocity of rotation and linear velocity;Obtain angular velocity of rotation component of the angular velocity of rotation in each preset coordinate axle and the angular speed direction in each preset coordinate axle;Obtain linear velocity component of the linear velocity in each preset coordinate axle;From each preset coordinate axle, determine that angular velocity of rotation component and linear velocity component exceed each target preset coordinate axle of predetermined threshold value;The angular velocity of rotation component of each target preset coordinate axle is compared, the maximum target preset coordinate axle of angular velocity of rotation component is obtained;From the corresponding relation of default angular speed direction and music switching direction, target music switching direction corresponding with the target preset coordinate axle is obtained;According to the target music switching direction, the music in switching terminal music playlist.Using the present invention, the convenience of music switching can be lifted.
Description
Technical field
The present invention relates to communication technical field, and in particular to a kind of method and terminal for realizing music switching.
Background technology
With the gradually popularization of mobile terminal, music is played on mobile terminals and has become the important amusement work(of people
Can, music is played in increasing people's selection on mobile terminals.When user plays music on mobile terminals, it is often necessary to will
Currently playing song be switched to next or upper one, it is necessary to user touch mobile terminal touch-screen or click on movement
Button in terminal realizes that music switches, and for large-size screen monitors mobile terminal, user operates inconvenience.
The content of the invention
The embodiment of the present invention provides a kind of method and terminal of music switching, can lift the convenience of music switching.
The embodiment of the present invention provides a kind of method for realizing music switching, including:
The rotary speed of terminal is detected, the rotary speed includes angular velocity of rotation and linear velocity;
The angular velocity of rotation is obtained in the angular velocity of rotation component of each preset coordinate axle and in each preset coordinate axle
Angular speed direction, each preset coordinate axle include X-axis, Y-axis and Z axis;
Obtain linear velocity component of the linear velocity in each preset coordinate axle;
From each preset coordinate axle, determine that angular velocity of rotation component and linear velocity component exceed default threshold
Each target preset coordinate axle of value;
The angular velocity of rotation component of each target preset coordinate axle is compared, angular velocity of rotation component is obtained maximum
Target preset coordinate axle;
From the corresponding relation of the angular speed direction of default preset coordinate axle and music switching direction, obtain and the rotation
The corresponding target music switching direction in angular speed direction of the maximum target preset coordinate axle of tarnsition velocity component;
According to the target music switching direction, the music in switching terminal music playlist.
Accordingly, the embodiment of the present invention also provides a kind of terminal, including:
First detection unit, the rotary speed for detecting terminal, the rotary speed includes angular velocity of rotation and rotation
Linear velocity;
First acquisition unit, for obtain the angular velocity of rotation the angular velocity of rotation component of each preset coordinate axle and
The angular speed direction of each preset coordinate axle, each preset coordinate axle includes X-axis, Y-axis and Z axis;
Second acquisition unit, for obtaining linear velocity point of the linear velocity in each preset coordinate axle
Amount;
Judging unit, for from each preset coordinate axle, determining angular velocity of rotation component and linear velocity point
Amount exceedes each target preset coordinate axle of predetermined threshold value;
Comparing unit, for the angular velocity of rotation component of each target preset coordinate axle to be compared, is rotated
The maximum target preset coordinate axle of angular velocity component;
Processing unit, for the corresponding relation from the angular speed direction of default preset coordinate axle and music switching direction
In, obtain target music corresponding with the angular speed direction for the target preset coordinate axle that the angular velocity of rotation component is maximum and switch
Direction;
Execution unit, for according to the target music switching direction, the music in switching terminal music playlist.
In the embodiment of the present invention, the rotary speed of terminal and corresponding direction of rotation are can detect, the rotation speed of terminal is judged
Whether degree exceedes predetermined threshold value, if so, the angular velocity of rotation of the preset coordinate axle more than predetermined threshold value is compared, is revolved
The maximum preset coordinate axle of tarnsition velocity and corresponding direction of rotation, by the corresponding rotation of preset coordinate axle that angular velocity of rotation is maximum
Turn switching law of the direction with pre-setting to be contrasted, obtain comparing result, according to comparing result, switching terminal music is broadcast
The music in table is emplaced, the mode that user switches music in terminal is enriched, the convenience of lifting music switching improves user
The interest of operation, improves Consumer's Experience.
Brief description of the drawings
Technical scheme in order to illustrate the embodiments of the present invention more clearly, below by using required in embodiment
Accompanying drawing is briefly described, it should be apparent that, drawings in the following description are only some embodiments of the present invention, for ability
For the those of ordinary skill of domain, on the premise of not paying creative work, it can also be obtained according to these accompanying drawings other attached
Figure.
Fig. 1 is a kind of flow chart for the method for realizing music switching disclosed in the embodiment of the present invention;
Fig. 2 is the flow chart of another method for realizing music switching disclosed in the embodiment of the present invention;
Fig. 3 is a kind of structural representation of terminal disclosed in the embodiment of the present invention;
Fig. 4 is the structural representation of another terminal disclosed in the embodiment of the present invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete
Site preparation is described, it is clear that described embodiment is only a part of embodiment of the invention, rather than whole embodiments.It is based on
Embodiment in the present invention, it is every other that those of ordinary skill in the art are obtained under the premise of creative work is not made
Embodiment, belongs to the scope of protection of the invention.
The embodiment of the present invention provides a kind of method and terminal of music switching, can lift the convenience of music switching.With
It is lower to be described in detail respectively.
Terminal described in the embodiment of the present invention may include:Mobile phone, tablet personal computer or walkman etc., above-mentioned terminal is only
Citing, and it is non exhaustive, including but not limited to above-mentioned terminal.
The method and the suitable application scenarios of terminal of music switching provided in an embodiment of the present invention can be the online sounds of terminal
It is happy to play or the broadcasting of terminal offline music.The embodiment of the present invention is played in terminal Online Music or offline music is played
When, terminal is rotated by user, the switching to the music in the music application in terminal music playing system is realized, wherein
Music playing system and the music application embodiment of the present invention are not limited.User is during terminal is rotated, and terminal can
In screen state of going out, may be at bright screen state, holding state can also be in, the embodiment of the present invention is not limited.
Referring to Fig. 1, Fig. 1 is a kind of flow chart for the method for realizing music switching disclosed in the embodiment of the present invention.This reality
Apply the method for realizing music switching described in example, including step:
S101, detects the rotary speed of terminal, and the rotary speed includes angular velocity of rotation and linear velocity.
In some feasible embodiments, the scene described in the embodiment of the present invention is user in terminal music
When playing music in, user's rotation terminal, 3-axis acceleration sensor and three-axis gyroscope the detection terminal of terminal built-in
Rotary speed, the anglec of rotation of the angular velocity of rotation for terminal in rotary course around a certain axle described in the embodiment of the present invention
Speed, a certain axle is a certain axle vertical with terminal rotating plane, and the size of angular velocity of rotation is rad/s (Radian per second), this
Linear velocity described in inventive embodiments for terminal certain one end during terminal rotating rotational trajectory tangent line
The speed in direction, the unit of linear velocity is m/s (metre per second (m/s)).
In the specific implementation, when terminal plays music in music application, user's rotation terminal, the three of terminal built-in
Axle acceleration sensor and three-axis gyroscope detect the angular velocity of rotation of terminal, the three-axis gyroscope detection terminal of terminal built-in
Linear velocity.
S102, obtains the angular velocity of rotation in the angular velocity of rotation component of each preset coordinate axle and in each preset coordinate axle
Angular speed direction, each preset coordinate axle includes X-axis, Y-axis and Z axis.
In some feasible embodiments, terminal is detected by built-in 3-axis acceleration sensor and three-axis gyroscope
After the angular velocity of rotation of terminal, angular velocity of rotation component of the angular velocity of rotation on X-axis, Y-axis and Z axis is obtained and in X
Angular speed direction on axle, Y-axis and Z axis.
In the specific implementation, when terminal plays music in music application, user's rotation terminal, terminal passes through built-in
3-axis acceleration sensor and three-axis gyroscope detection terminal angular velocity of rotation after, by the angular velocity of rotation in X-axis, Y
Projected respectively on axle and Z axis, obtain angular velocity of rotation component of the angular velocity of rotation on X-axis, Y-axis and Z axis and in X
The angular speed direction of angular speed direction on axle, Y-axis and Z axis, the wherein angular velocity of rotation on X-axis, Y-axis and Z axis can
Think clockwise or counterclockwise.
S103, obtains linear velocity component of the linear velocity in each preset coordinate axle.
In some feasible embodiments, terminal detects the rotational line of terminal by built-in 3-axis acceleration sensor
After speed, linear velocity component of the linear velocity on X-axis, Y-axis and Z axis is obtained.
In the specific implementation, when terminal plays music in music application, user's rotation terminal, terminal passes through built-in
3-axis acceleration sensor detection terminal linear velocity after, by the linear velocity on X-axis, Y-axis and Z axis point
Do not projected, obtain linear velocity component of the linear velocity on X-axis, Y-axis and Z axis.
S104, from each preset coordinate axle, determines that angular velocity of rotation component and linear velocity component exceed default
Each target preset coordinate axle of threshold value.
In some feasible embodiments, terminal is detected by built-in 3-axis acceleration sensor and three-axis gyroscope
After the angular velocity of rotation and linear velocity of terminal, anglec of rotation speed of the angular velocity of rotation on X-axis, Y-axis and Z axis is obtained
Component and linear velocity component of the linear velocity on X-axis, Y-axis and Z axis are spent, from each preset coordinate axle, it is determined that
Go out each target preset coordinate axle that angular velocity of rotation component and linear velocity component exceed predetermined threshold value.
In the specific implementation, when terminal plays music in music application, user's rotation terminal, terminal passes through built-in
3-axis acceleration sensor and three-axis gyroscope detection terminal angular velocity of rotation and linear velocity after, obtain the anglec of rotation
Angular velocity of rotation component and acquisition linear velocity rotation X-axis, Y-axis and Z axis on of the speed on X-axis, Y-axis and Z axis
Turn linear velocity component.Judge whether angular velocity of rotation component and linear velocity component in X-axis exceed predetermined threshold value, if
It is then to judge X-axis for target preset coordinate axle;Judge whether angular velocity of rotation component and linear velocity component in Y-axis are equal
More than predetermined threshold value, if so, then judging Y-axis for target preset coordinate axle;Judge angular velocity of rotation component and the rotational line on Z axis
Whether velocity component exceedes predetermined threshold value, if so, then judging Z axis for target preset coordinate axle.
S105, the angular velocity of rotation component of each target preset coordinate axle is compared, angular velocity of rotation component is obtained most
Big target preset coordinate axle.
In some feasible embodiments, terminal obtains anglec of rotation speed of the angular velocity of rotation on X-axis, Y-axis and Z axis
Spend after linear velocity component on X-axis, Y-axis and Z axis of component and linear velocity, determine angular velocity of rotation component and
Linear velocity component exceedes each target preset coordinate axle of predetermined threshold value, by the angular velocity of rotation of each target preset coordinate axle
Component is compared, and obtains the maximum target preset coordinate axle of angular velocity of rotation component.
In the specific implementation, when terminal plays music in music application, user's rotation terminal, terminal passes through built-in
3-axis acceleration sensor and three-axis gyroscope detection terminal angular velocity of rotation and linear velocity after, obtain the anglec of rotation
Angular velocity of rotation component and acquisition linear velocity rotation X-axis, Y-axis and Z axis on of the speed on X-axis, Y-axis and Z axis
Turn linear velocity component, from each preset coordinate axle, determine that angular velocity of rotation component and linear velocity component exceed default
Each target preset coordinate axle of threshold value.If it is determined that target preset coordinate axle be X-axis and Y-axis, then compare angular velocity of rotation in X-axis
On angular velocity component and angular velocity of rotation component of the angular velocity of rotation in Y-axis, obtain the maximum seat of angular velocity of rotation component
Parameter.
S106, from the corresponding relation of the angular speed direction of default preset coordinate axle and music switching direction, obtain with
The corresponding target music switching direction in angular speed direction of the maximum target preset coordinate axle of the angular velocity of rotation component.
In some feasible embodiments, terminal is obtained after the maximum target preset coordinate axle of angular velocity of rotation component,
From the corresponding relation of the angular speed direction of default preset coordinate axle and music switching direction, obtain and the angular velocity of rotation point
Measure the corresponding target music switching direction in angular speed direction of maximum target preset coordinate axle.
In the specific implementation, when terminal plays music in music application, user's rotation terminal, terminal passes through built-in
3-axis acceleration sensor and three-axis gyroscope detection terminal angular velocity of rotation and linear velocity after, obtain the anglec of rotation
Angular velocity of rotation component and acquisition linear velocity rotation X-axis, Y-axis and Z axis on of the speed on X-axis, Y-axis and Z axis
Turn linear velocity component, from each preset coordinate axle, determine that angular velocity of rotation component and linear velocity component exceed default
Each target preset coordinate axle of threshold value.If it is determined that target preset coordinate axle be X-axis and Y-axis, then compare angular velocity of rotation in X-axis
On angular velocity component and angular velocity of rotation component of the angular velocity of rotation in Y-axis, if angle speed of the angular velocity of rotation in X-axis
Spend component maximum, then according to the angular speed direction of X-axis target music corresponding with being obtained in the corresponding relation of music switching direction
Switching direction, if the angular speed direction of X-axis is clockwise, corresponding target music switching direction is clockwise direction, such as
The angular speed direction of fruit X-axis is counterclockwise, then corresponding target music switching direction is counterclockwise.
S107, according to the target music switching direction, the music in switching terminal music playlist.
In some feasible embodiments, terminal obtains corresponding target music switching direction, according to the target music
Music in switching direction, switching terminal music playlist.
In the specific implementation, when terminal plays music in music application, user's rotation terminal, terminal passes through built-in
3-axis acceleration sensor and three-axis gyroscope detection terminal angular velocity of rotation and linear velocity after, obtain the anglec of rotation
Angular velocity of rotation component and acquisition linear velocity rotation X-axis, Y-axis and Z axis on of the speed on X-axis, Y-axis and Z axis
Turn linear velocity component, from each preset coordinate axle, determine that angular velocity of rotation component and linear velocity component exceed default
Each target preset coordinate axle of threshold value.If it is determined that target preset coordinate axle be X-axis and Y-axis, then compare angular velocity of rotation in X-axis
On angular velocity component and angular velocity of rotation component of the angular velocity of rotation in Y-axis, if angle speed of the angular velocity of rotation in X-axis
Spend component maximum, then according to the angular speed direction of X-axis target music corresponding with being obtained in the corresponding relation of music switching direction
Switching direction, if the angular speed direction of X-axis is clockwise, corresponding target music switching direction is clockwise direction, is cut
The music supreme one changed in terminal music playlist is first, if the angular speed direction of X-axis is counterclockwise, corresponding target sound
Happy switching direction for counterclockwise, music in switching terminal music playlist to next.
In embodiments of the present invention, terminal can be examined by the 3-axis acceleration sensor and three-axis gyroscope of terminal built-in
The angular velocity of rotation and linear velocity of terminal are surveyed, show that angular velocity of rotation and linear velocity exceed default threshold by comparing
The maximum target preset coordinate axle of the angular velocity of rotation of value, according to the angle speed of the maximum target preset coordinate axle of the angular velocity of rotation
Direction is spent with the corresponding relation of music switching direction, obtaining corresponding target music switching direction, being cut according to the target music
The music changed in direction, switching terminal music playlist, the convenience of lifting music switching, improves the entertaining of user's operation
Property, improve Consumer's Experience.
Referring to Fig. 2, Fig. 2 is the flow chart of another method for realizing music switching disclosed in the embodiment of the present invention.This
The method for realizing music switching described in embodiment, including step:
S201, the open command of detection input music application.
In some feasible embodiments, the open command of terminal detection input music application, the open command
For terminal open a terminal on music application, the open command can for user's manual key input, or mouse
Punctuate hits input, or user's touch-screen is inputted, and the embodiment of the present invention is not limited.
S202, responds the open command, opens music application, and enter the terminal music that music is applied
List carries out music.
In some feasible embodiments, the open command of terminal detection input music application responds the unlatching
Instruction, opens music application, and enter the terminal music playlist progress music that music is applied, the music
Playlist can be local playlist, or online playlist, the embodiment of the present invention is not limited.
S203, detects the rotary speed of terminal, and the rotary speed includes angular velocity of rotation and linear velocity.
In some feasible embodiments, the scene described in the embodiment of the present invention is user in terminal music
When playing music in, user's rotation terminal, 3-axis acceleration sensor and three-axis gyroscope the detection terminal of terminal built-in
Rotary speed, the anglec of rotation of the angular velocity of rotation for terminal in rotary course around a certain axle described in the embodiment of the present invention
Speed, a certain axle is a certain axle vertical with terminal rotating plane, and the size of angular velocity of rotation is rad/s (Radian per second), this
Linear velocity described in inventive embodiments for terminal certain one end during terminal rotating rotational trajectory tangent line
The speed in direction, the unit of linear velocity is m/s (metre per second (m/s)).
In the specific implementation, when terminal plays music in music application, user's rotation terminal, the three of terminal built-in
Axle acceleration sensor and three-axis gyroscope detect the angular velocity of rotation of terminal, the three-axis gyroscope detection terminal of terminal built-in
Linear velocity.
S204, obtains the angular velocity of rotation in the angular velocity of rotation component of each preset coordinate axle and in each preset coordinate axle
Angular speed direction, each preset coordinate axle includes X-axis, Y-axis and Z axis.
In some feasible embodiments, terminal is detected by built-in 3-axis acceleration sensor and three-axis gyroscope
After the angular velocity of rotation of terminal, angular velocity of rotation component of the angular velocity of rotation on X-axis, Y-axis and Z axis is obtained and in X
Angular speed direction on axle, Y-axis and Z axis.
In the specific implementation, when terminal plays music in music application, user's rotation terminal, terminal passes through built-in
3-axis acceleration sensor and three-axis gyroscope detection terminal angular velocity of rotation after, by the angular velocity of rotation in X-axis, Y
Projected respectively on axle and Z axis, obtain angular velocity of rotation component of the angular velocity of rotation on X-axis, Y-axis and Z axis and in X
The angular speed direction of angular speed direction on axle, Y-axis and Z axis, the wherein angular velocity of rotation in X-axis can be side clockwise
To or counterclockwise.
S205, obtains linear velocity component of the linear velocity in each preset coordinate axle.
In some feasible embodiments, terminal detects the rotational line of terminal by built-in 3-axis acceleration sensor
After speed, linear velocity component of the linear velocity on X-axis, Y-axis and Z axis is obtained.
In the specific implementation, when terminal plays music in music application, user's rotation terminal, terminal passes through built-in
3-axis acceleration sensor detection terminal linear velocity after, by the linear velocity on X-axis, Y-axis and Z axis point
Do not projected, obtain linear velocity component of the linear velocity on X-axis, Y-axis and Z axis.
S206, for each preset coordinate axle in each preset coordinate axle, judges the angular velocity of rotation of the preset coordinate axle
Whether component exceedes default angular velocity of rotation component threshold value.
In some feasible embodiments, for each preset coordinate axle in each preset coordinate axle, judge that this is preset
Whether the angular velocity of rotation component of reference axis exceedes default angular velocity of rotation component threshold value.For example, X-axis, Y-axis and Z are judged
Whether the angular velocity of rotation component of axle exceedes default angular velocity of rotation component threshold value, and the angular velocity of rotation component threshold value can be set to
3rad/s, 5rad/s, 8rad/s or other angular velocity of rotation component threshold values, the embodiment of the present invention are not limited.
S207, if it exceeds default angular velocity of rotation component threshold value, judges the linear velocity component of the preset coordinate axle
Whether default linear velocity component threshold value is exceeded, if it exceeds default linear velocity component threshold value, determines the preset coordinate
Axle is target preset coordinate axle.
In some feasible embodiments, if the angular velocity of rotation component of the preset coordinate axle exceedes the default anglec of rotation
Velocity component threshold value, judges whether the linear velocity component of the preset coordinate axle exceedes default linear velocity component threshold value,
If it exceeds default linear velocity component threshold value, it is target preset coordinate axle to determine the preset coordinate axle.For example, if sentencing
The angular velocity of rotation component of disconnected X-axis, Y-axis and Z axis exceedes after default angular velocity of rotation component threshold value, judges the rotational line of X-axis
Whether velocity component exceedes default linear velocity component threshold value, if exceeding, and it is target preset coordinate axle to determine X-axis;Judge Y-axis
Linear velocity component whether exceed default linear velocity component threshold value, if exceeding, it is target preset coordinate to determine Y-axis
Axle;Judge whether the linear velocity component of Z axis exceedes default linear velocity component threshold value, if being no more than, determine that Z axis is not
Target preset coordinate axle.The linear velocity component threshold value can be set to 0.1m/s, 0.3m/s, 0.5m/s or other rotational lines
Velocity component threshold value, the embodiment of the present invention is not limited.
S208, the angular velocity of rotation component of each target preset coordinate axle is compared, angular velocity of rotation component is obtained most
Big target preset coordinate axle.
In some feasible embodiments, terminal obtains anglec of rotation speed of the angular velocity of rotation on X-axis, Y-axis and Z axis
Spend after linear velocity component on X-axis, Y-axis and Z axis of component and linear velocity, determine angular velocity of rotation component and
Linear velocity component exceedes each target preset coordinate axle of predetermined threshold value, by the angular velocity of rotation of each target preset coordinate axle
Component is compared, and obtains the maximum target preset coordinate axle of angular velocity of rotation component.
In the specific implementation, when terminal plays music in music application, user's rotation terminal, terminal passes through built-in
3-axis acceleration sensor and three-axis gyroscope detection terminal angular velocity of rotation and linear velocity after, obtain the anglec of rotation
Angular velocity of rotation component and acquisition linear velocity rotation X-axis, Y-axis and Z axis on of the speed on X-axis, Y-axis and Z axis
Turn linear velocity component, from each preset coordinate axle, determine that angular velocity of rotation component and linear velocity component exceed default
Each target preset coordinate axle of threshold value.If it is determined that target preset coordinate axle be X-axis and Y-axis, then compare angular velocity of rotation in Y-axis
On angular velocity component and angular velocity of rotation component of the angular velocity of rotation in Y-axis, obtain the maximum seat of angular velocity of rotation component
Parameter.
S209, from the corresponding relation of the angular speed direction of default preset coordinate axle and music switching direction, obtain with
The corresponding target music switching direction in angular speed direction of the maximum target preset coordinate axle of the angular velocity of rotation component.
In some feasible embodiments, terminal is obtained after the maximum target preset coordinate axle of angular velocity of rotation component,
From the corresponding relation of the angular speed direction of default preset coordinate axle and music switching direction, obtain and the angular velocity of rotation point
Measure the corresponding target music switching direction in angular speed direction of maximum target preset coordinate axle.
In the specific implementation, when terminal plays music in music application, user's rotation terminal, terminal passes through built-in
3-axis acceleration sensor and three-axis gyroscope detection terminal angular velocity of rotation and linear velocity after, obtain the anglec of rotation
Angular velocity of rotation component and acquisition linear velocity rotation X-axis, Y-axis and Z axis on of the speed on X-axis, Y-axis and Z axis
Turn linear velocity component, from each preset coordinate axle, determine that angular velocity of rotation component and linear velocity component exceed default
Each target preset coordinate axle of threshold value.If it is determined that target preset coordinate axle be X-axis and Y-axis, then compare angular velocity of rotation in X-axis
On angular velocity component and angular velocity of rotation component of the angular velocity of rotation in Y-axis, if angle speed of the angular velocity of rotation in X-axis
Spend component maximum, then according to the angular speed direction of X-axis target music corresponding with being obtained in the corresponding relation of music switching direction
Switching direction, if the angular speed direction of X-axis is clockwise, corresponding target music switching direction is clockwise direction, such as
The angular speed direction of fruit X-axis is counterclockwise, then corresponding target music switching direction is counterclockwise.
S210, according to the target music switching direction, the music in switching terminal music playlist.
In some feasible embodiments, terminal obtains corresponding target music switching direction, according to the target music
Music in switching direction, switching terminal music playlist.
In the specific implementation, when terminal plays music in music application, user's rotation terminal, terminal passes through built-in
3-axis acceleration sensor and three-axis gyroscope detection terminal angular velocity of rotation and linear velocity after, obtain the anglec of rotation
Angular velocity of rotation component and acquisition linear velocity rotation X-axis, Y-axis and Z axis on of the speed on X-axis, Y-axis and Z axis
Turn linear velocity component, from each preset coordinate axle, determine that angular velocity of rotation component and linear velocity component exceed default
Each target preset coordinate axle of threshold value.If it is determined that target preset coordinate axle be X-axis and Y-axis, then compare angular velocity of rotation in X-axis
On angular velocity component and angular velocity of rotation component of the angular velocity of rotation in Y-axis, if angle speed of the angular velocity of rotation in X-axis
Spend component maximum, then according to the angular speed direction of X-axis target music corresponding with being obtained in the corresponding relation of music switching direction
Switching direction, if the angular speed direction of X-axis is clockwise, corresponding target music switching direction is clockwise direction, is cut
The music supreme one changed in terminal music playlist is first, if the angular speed direction of X-axis is counterclockwise, corresponding target sound
Happy switching direction for counterclockwise, music in switching terminal music playlist to next.
In embodiments of the present invention, terminal can detect that the unlatching of input music application refers to, and respond the open command,
Music application is opened, and enters the terminal music playlist progress music that music is applied, terminal can lead to
The 3-axis acceleration sensor and three-axis gyroscope for crossing terminal built-in detect the angular velocity of rotation and linear velocity of terminal, pass through
Compare the target preset coordinate axle for drawing the angular velocity of rotation maximum that angular velocity of rotation and linear velocity exceed predetermined threshold value,
According to the maximum angular speed direction of target preset coordinate axle of the angular velocity of rotation with the corresponding relation of music switching direction, obtaining
Corresponding target music switching direction is taken, according to the target music switching direction, the music in switching terminal music playlist,
The convenience of music switching is lifted, the interest of user's operation is improved, improves Consumer's Experience.
Referring to Fig. 3, Fig. 3 is a kind of structural representation of terminal disclosed in the embodiment of the present invention.Described in the present embodiment
Terminal, including:
First detection unit 301, the rotary speed for detecting terminal, rotary speed includes angular velocity of rotation and rotation
Linear velocity.
In some feasible embodiments, the scene described in the embodiment of the present invention is user in terminal music
When playing music in, user's rotation terminal, the first detection unit 301 detects the rotary speed of terminal, the embodiment of the present invention
Described in angular velocity of rotation of the angular velocity of rotation for terminal in rotary course around a certain axle, a certain axle is and terminal rotating
The vertical a certain axle of plane, the size of angular velocity of rotation is rad/s (Radian per second), the rotation described in the embodiment of the present invention
Linear velocity for terminal certain one end during terminal rotating rotational trajectory tangential direction speed, the list of linear velocity
Position is m/s (metre per second (m/s)).
In the specific implementation, when terminal plays music in music application, user's rotation terminal, the first detection unit
The angular velocity of rotation and linear velocity of 301 detection terminals.
First acquisition unit 302, for obtain the angular velocity of rotation each preset coordinate axle angular velocity of rotation component and
In the angular speed direction of each preset coordinate axle, each preset coordinate axle includes X-axis, Y-axis and Z axis.
In some feasible embodiments, after the angular velocity of rotation of the first detection unit 301 detection terminal, first obtains
Unit 302 is taken to obtain angular velocity of rotation component of the angular velocity of rotation on X-axis, Y-axis and Z axis and in X-axis, Y-axis and Z axis
On angular speed direction.
In the specific implementation, when terminal plays music in music application, user's rotation terminal, the first detection unit
After the angular velocity of rotation of 301 detection terminals, the angular velocity of rotation is projected respectively on X-axis, Y-axis and Z axis, first
Acquiring unit 302 obtains angular velocity of rotation component of the angular velocity of rotation on X-axis, Y-axis and Z axis and in X-axis, Y-axis and Z axis
On angular speed direction, wherein angular speed direction of the angular velocity of rotation on X-axis, Y-axis and Z axis can for clockwise
Or counterclockwise.
Second acquisition unit 303, for obtaining linear velocity component of the linear velocity in each preset coordinate axle.
In some feasible embodiments, after the linear velocity of the first detection unit 301 detection terminal, second obtains
Unit 303 is taken to obtain linear velocity component of the linear velocity on X-axis, Y-axis and Z axis.
In the specific implementation, when terminal plays music in music application, user's rotation terminal, the first detection unit
After the linear velocity of 301 detection terminals, the linear velocity is projected respectively on X-axis, Y-axis and Z axis, second
Acquiring unit 303 obtains linear velocity component of the linear velocity on X-axis, Y-axis and Z axis.
Judging unit 304, for from each preset coordinate axle, determining angular velocity of rotation component and linear velocity component
Exceed each target preset coordinate axle of predetermined threshold value.
In some feasible embodiments, the angular velocity of rotation and rotation linear speed of the first detection unit 301 detection terminal
After degree, first acquisition unit 302 obtains angular velocity of rotation component of the angular velocity of rotation on X-axis, Y-axis and Z axis and the
Two acquiring units 303 obtain linear velocity component of the linear velocity on X-axis, Y-axis and Z axis, judging unit 304 from
In each preset coordinate axle, determine that each target of angular velocity of rotation component and linear velocity component more than predetermined threshold value is preset
Reference axis.
In the specific implementation, when terminal plays music in music application, user's rotation terminal, the first detection unit
After the angular velocity of rotation and linear velocity of 301 detection terminals, first acquisition unit 302 obtains angular velocity of rotation in X-axis, Y
Angular velocity of rotation component and second acquisition unit 303 on axle and Z axis obtain linear velocity on X-axis, Y-axis and Z axis
Linear velocity component.Judging unit 304 judges whether angular velocity of rotation component and linear velocity component in X-axis surpass
Predetermined threshold value is crossed, if so, then judging X-axis for target preset coordinate axle;Judging unit 304 judges the angular velocity of rotation point in Y-axis
Whether amount and linear velocity component exceed predetermined threshold value, if so, then judging Y-axis for target preset coordinate axle;Judging unit
304 judge whether angular velocity of rotation component and linear velocity component on Z axis exceed predetermined threshold value, if so, then judging Z axis
For target preset coordinate axle.
Comparing unit 305, for the angular velocity of rotation component of each target preset coordinate axle to be compared, obtains the anglec of rotation
The maximum target preset coordinate axle of velocity component.
In some feasible embodiments, first acquisition unit 302 obtains angular velocity of rotation in X-axis, Y-axis and Z axis
On angular velocity of rotation component and second acquisition unit 303 obtain rotation linear speed of the linear velocity on X-axis, Y-axis and Z axis
Spend after component, judging unit 304 determines that angular velocity of rotation component and linear velocity component exceed each mesh of predetermined threshold value
Preset coordinate axle is marked, the angular velocity of rotation component of each target preset coordinate axle is compared by comparing unit 305, obtains the anglec of rotation
The maximum target preset coordinate axle of velocity component.
In the specific implementation, when terminal plays music in music application, user's rotation terminal, the first detection unit
After the angular velocity of rotation and linear velocity of 301 detection terminals, first acquisition unit 302 obtains angular velocity of rotation in X-axis, Y
Angular velocity of rotation component and second acquisition unit 303 on axle and Z axis obtain linear velocity on X-axis, Y-axis and Z axis
Linear velocity component, judging unit 304 determines angular velocity of rotation component and linear velocity from each preset coordinate axle
Component exceedes each target preset coordinate axle of predetermined threshold value.If it is determined that target preset coordinate axle be X-axis and Y-axis, it is relatively single
Member 305 then compares angular velocity component of the angular velocity of rotation in X-axis and angular velocity of rotation component of the angular velocity of rotation in Y-axis,
Obtain the maximum reference axis of angular velocity of rotation component.
Processing unit 306, for being closed from the angular speed direction of default preset coordinate axle is corresponding with music switching direction
In system, obtain target music corresponding with the angular speed direction for the target preset coordinate axle that the angular velocity of rotation component is maximum and switch
Direction.
In some feasible embodiments, comparing unit 305 obtains the default seat of the maximum target of angular velocity of rotation component
After parameter, processing unit 306 is obtained from the corresponding relation of the angular speed direction of default preset coordinate axle and music switching direction
Take target music switching direction corresponding with the angular speed direction for the target preset coordinate axle that the angular velocity of rotation component is maximum.
In the specific implementation, when terminal plays music in music application, user's rotation terminal, the first detection unit
After the angular velocity of rotation and linear velocity of 301 detection terminals, first acquisition unit 302 obtains angular velocity of rotation in X-axis, Y
Angular velocity of rotation component and second acquisition unit 303 on axle and Z axis obtain linear velocity on X-axis, Y-axis and Z axis
Linear velocity component, judging unit 304 determines angular velocity of rotation component and linear velocity from each preset coordinate axle
Component exceedes each target preset coordinate axle of predetermined threshold value.If it is determined that target preset coordinate axle be X-axis and Y-axis, it is relatively single
Member 305 then compares angular velocity component of the angular velocity of rotation in X-axis and angular velocity of rotation component of the angular velocity of rotation in Y-axis,
If angular velocity component of the angular velocity of rotation in X-axis is maximum, processing unit 306 is then according to the angular speed direction of X-axis and music
Corresponding target music switching direction is obtained in the corresponding relation of switching direction, if the angular speed direction of X-axis is clockwise,
Corresponding target music switching direction is clockwise direction, if the angular speed direction of X-axis is counterclockwise, corresponding target sound
Happy switching direction is counterclockwise.
Execution unit 307, for according to the target music switching direction, the music in switching terminal music playlist.
In some feasible embodiments, processing unit 306 obtains corresponding target music switching direction, according to the mesh
Music in the happy switching direction of mark with phonetic symbols, switching terminal music playlist.
In the specific implementation, when terminal plays music in music application, user's rotation terminal, the first detection unit
After the angular velocity of rotation and linear velocity of 301 detection terminals, first acquisition unit 302 obtains angular velocity of rotation in X-axis, Y
Angular velocity of rotation component and second acquisition unit 303 on axle and Z axis obtain linear velocity on X-axis, Y-axis and Z axis
Linear velocity component, judging unit 304 determines angular velocity of rotation component and linear velocity from each preset coordinate axle
Component exceedes each target preset coordinate axle of predetermined threshold value.If it is determined that target preset coordinate axle be X-axis and Y-axis, it is relatively single
Member 305 then compares angular velocity component of the angular velocity of rotation in X-axis and angular velocity of rotation component of the angular velocity of rotation in Y-axis,
If angular velocity component of the angular velocity of rotation in X-axis is maximum, processing unit 306 is then according to the angular speed direction of X-axis and music
Corresponding target music switching direction is obtained in the corresponding relation of switching direction, if the angular speed direction of X-axis is clockwise,
Corresponding target music switching direction is clockwise, the music in the switching terminal music playlist of execution unit 307 is extremely
Upper one is first, if the angular speed direction of X-axis is counterclockwise, and corresponding target music switching direction is counter clockwise direction, is performed
Music in the switching terminal music playlist of unit 307 to next.
In embodiments of the present invention, terminal can be examined by the 3-axis acceleration sensor and three-axis gyroscope of terminal built-in
The angular velocity of rotation and linear velocity of terminal are surveyed, show that angular velocity of rotation and linear velocity exceed default threshold by comparing
The maximum target preset coordinate axle of the angular velocity of rotation of value, according to the angle speed of the maximum target preset coordinate axle of the angular velocity of rotation
Direction is spent with the corresponding relation of music switching direction, obtaining corresponding target music switching direction, being cut according to the target music
The music changed in direction, switching terminal music playlist, the convenience of lifting music switching, improves the entertaining of user's operation
Property, improve Consumer's Experience.
Referring to Fig. 4, Fig. 4 is the structural representation of another terminal disclosed in the embodiment of the present invention.Retouched in the present embodiment
The terminal stated, including:
Second detection unit 401, the open command for detecting input music application.
In some feasible embodiments, the open command of the second detection unit 401 detection input music application,
The open command be used for terminal open a terminal on music application, the open command can for user's manual key input,
Input can also be clicked on for mouse, or user's touch-screen is inputted, the embodiment of the present invention is not limited.
Broadcast unit 402, for responding open command, opens music application, and enter the end that music is applied
Music playlist is held to carry out music.
In some feasible embodiments, the open command of the second detection unit 401 detection input music application,
Broadcast unit 402 responds the open command, opens music application, and enter the terminal music row that music is applied
Table carries out music, and the music playlist can be local playlist, or online playlist, the present invention is real
Example is applied not limit.
First detection unit 403, the rotary speed for detecting terminal, rotary speed includes angular velocity of rotation and rotation
Linear velocity.
In some feasible embodiments, the scene described in the embodiment of the present invention is user in terminal music
When playing music in, user's rotation terminal, the first detection unit 403 detects the rotary speed of terminal, the embodiment of the present invention
Described in angular velocity of rotation of the angular velocity of rotation for terminal in rotary course around a certain axle, a certain axle is and terminal rotating
The vertical a certain axle of plane, the size of angular velocity of rotation is rad/s (Radian per second), the rotation described in the embodiment of the present invention
Linear velocity for terminal certain one end during terminal rotating rotational trajectory tangential direction speed, the list of linear velocity
Position is m/s (metre per second (m/s)).
In the specific implementation, when terminal plays music in music application, user's rotation terminal, the first detection unit
The angular velocity of rotation and linear velocity of 403 detection terminals.
First acquisition unit 404, for obtain the angular velocity of rotation each preset coordinate axle angular velocity of rotation component and
In the angular speed direction of each preset coordinate axle, each preset coordinate axle includes X-axis, Y-axis and Z axis.
In some feasible embodiments, after the angular velocity of rotation of the first detection unit 403 detection terminal, first obtains
Unit 404 is taken to obtain angular velocity of rotation component of the angular velocity of rotation on X-axis, Y-axis and Z axis and in X-axis, Y-axis and Z axis
On angular speed direction.
In the specific implementation, when terminal plays music in music application, user's rotation terminal, the first detection unit
After the angular velocity of rotation of 403 detection terminals, the angular velocity of rotation is projected respectively on X-axis, Y-axis and Z axis, first
Acquiring unit 404 obtains angular velocity of rotation component of the angular velocity of rotation on X-axis, Y-axis and Z axis and in X-axis, Y-axis and Z axis
On angular speed direction, wherein angular speed direction of the angular velocity of rotation in X-axis can for clockwise or counterclockwise side
To.
Second acquisition unit 405, for obtaining linear velocity component of the linear velocity in each preset coordinate axle.
In some feasible embodiments, after the linear velocity of the first detection unit 403 detection terminal, second obtains
Unit 405 is taken to obtain linear velocity component of the linear velocity on X-axis, Y-axis and Z axis.
In the specific implementation, when terminal plays music in music application, user's rotation terminal, the first detection unit
After the linear velocity of 403 detection terminals, the linear velocity is projected respectively on X-axis, Y-axis and Z axis, second
Acquiring unit 405 obtains linear velocity component of the linear velocity on X-axis, Y-axis and Z axis.
Judging unit 406, including the first judgment sub-unit 4601 and the second judgment sub-unit 4602.
First judgment sub-unit 4601, for for each preset coordinate axle in each preset coordinate axle, judging that this is preset
Whether the angular velocity of rotation component of reference axis exceedes default angular velocity of rotation component threshold value.
In some feasible embodiments, the first judgment sub-unit 4601 is directed to each default in each preset coordinate axle
Reference axis, judges whether the angular velocity of rotation component of the preset coordinate axle exceedes default angular velocity of rotation component threshold value.Citing comes
Say, the first judgment sub-unit 4601 judges whether the angular velocity of rotation component of X-axis, Y-axis and Z axis exceedes default angular velocity of rotation point
Threshold value is measured, the angular velocity of rotation component threshold value can be set to 3rad/s, 5rad/s, 8rad/s or other angular velocity of rotation components
Threshold value, the embodiment of the present invention is not limited.
Second judgment sub-unit 4602, during for being when the judged result of the first judgment sub-unit 4601, judges that this is preset
Whether the linear velocity component of reference axis exceedes default linear velocity component threshold value, if it exceeds default linear velocity point
Threshold value is measured, it is target preset coordinate axle to determine the preset coordinate axle.
In some feasible embodiments, if the angular velocity of rotation component of the preset coordinate axle exceedes the default anglec of rotation
Velocity component threshold value, the second judgment sub-unit 4602 judges whether the linear velocity component of the preset coordinate axle exceedes default rotation
Turn linear velocity component threshold value, if it exceeds default linear velocity component threshold value, determines that the preset coordinate axle is sat for target is default
Parameter.For example, the first judgment sub-unit 4601 judges that the angular velocity of rotation component of X-axis, Y-axis and Z axis exceedes default rotation
After tarnsition velocity component threshold value, the second judgment sub-unit 4602 judges whether the linear velocity component of X-axis exceedes default rotation
Linear velocity component threshold value, if exceeding, it is target preset coordinate axle to determine X-axis;Second judgment sub-unit 4602 judges the rotation of Y-axis
Whether linear velocity component exceedes default linear velocity component threshold value, if exceeding, and it is target preset coordinate axle to determine Y-axis;Second
Judgment sub-unit 4602 judges whether the linear velocity component of Z axis exceedes default linear velocity component threshold value, if being no more than,
It is not target preset coordinate axle to determine Z axis.The linear velocity component threshold value can be set to 0.1m/s, 0.3m/s, 0.5m/s or
Other linear velocity component threshold values of person, the embodiment of the present invention is not limited.
Comparing unit 407, for the angular velocity of rotation component of each target preset coordinate axle to be compared, obtains the anglec of rotation
The maximum target preset coordinate axle of velocity component.
In some feasible embodiments, first acquisition unit 404 obtains angular velocity of rotation in X-axis, Y-axis and Z axis
On angular velocity of rotation component and second acquisition unit 405 obtain rotation linear speed of the linear velocity on X-axis, Y-axis and Z axis
Spend after component, judging unit 406 determines that angular velocity of rotation component and linear velocity component exceed each mesh of predetermined threshold value
Preset coordinate axle is marked, the angular velocity of rotation component of each target preset coordinate axle is compared by comparing unit 407, obtains the anglec of rotation
The maximum target preset coordinate axle of velocity component.
In the specific implementation, when terminal plays music in music application, user's rotation terminal, the first detection unit
After the angular velocity of rotation and linear velocity of 403 detection terminals, first acquisition unit 404 obtains angular velocity of rotation in X-axis, Y
Angular velocity of rotation component and second acquisition unit 405 on axle and Z axis obtain linear velocity on X-axis, Y-axis and Z axis
Linear velocity component, judging unit 406 determines angular velocity of rotation component and linear velocity from each preset coordinate axle
Component exceedes each target preset coordinate axle of predetermined threshold value.If it is determined that target preset coordinate axle be X-axis and Y-axis, it is relatively single
Member 407 then compares angular velocity component of the angular velocity of rotation in X-axis and angular velocity of rotation component of the angular velocity of rotation in Y-axis,
Obtain the maximum reference axis of angular velocity of rotation component.
Processing unit 408, for being closed from the angular speed direction of default preset coordinate axle is corresponding with music switching direction
In system, obtain target music corresponding with the angular speed direction for the target preset coordinate axle that the angular velocity of rotation component is maximum and switch
Direction.
In some feasible embodiments, comparing unit 407 obtains the default seat of the maximum target of angular velocity of rotation component
After parameter, processing unit 408 is obtained from the corresponding relation of the angular speed direction of default preset coordinate axle and music switching direction
Take target music switching direction corresponding with the angular speed direction for the target preset coordinate axle that the angular velocity of rotation component is maximum.
In the specific implementation, when terminal plays music in music application, user's rotation terminal, the first detection unit
After the angular velocity of rotation and linear velocity of 403 detection terminals, first acquisition unit 404 obtains angular velocity of rotation in X-axis, Y
Angular velocity of rotation component and second acquisition unit 405 on axle and Z axis obtain linear velocity on X-axis, Y-axis and Z axis
Linear velocity component, judging unit 406 determines angular velocity of rotation component and linear velocity from each preset coordinate axle
Component exceedes each target preset coordinate axle of predetermined threshold value.If it is determined that target preset coordinate axle be X-axis and Y-axis, it is relatively single
Member 407 then compares angular velocity component of the angular velocity of rotation in X-axis and angular velocity of rotation component of the angular velocity of rotation in Y-axis,
If angular velocity component of the angular velocity of rotation in X-axis is maximum, processing unit 408 is then according to the angular speed direction of X-axis and music
Corresponding target music switching direction is obtained in the corresponding relation of switching direction, if the angular speed direction of X-axis is clockwise,
Corresponding target music switching direction is clockwise direction, if the angular speed direction of X-axis is counterclockwise, corresponding target sound
Happy switching direction is counterclockwise.
Execution unit 409, for according to the target music switching direction, the music in switching terminal music playlist.
In some feasible embodiments, processing unit 408 obtains corresponding target music switching direction, according to the mesh
Music in the happy switching direction of mark with phonetic symbols, switching terminal music playlist.
In the specific implementation, when terminal plays music in music application, user's rotation terminal, the first detection unit
After the angular velocity of rotation and linear velocity of 403 detection terminals, first acquisition unit 404 obtains angular velocity of rotation in X-axis, Y
Angular velocity of rotation component and second acquisition unit 405 on axle and Z axis obtain linear velocity on X-axis, Y-axis and Z axis
Linear velocity component, judging unit 406 determines angular velocity of rotation component and linear velocity from each preset coordinate axle
Component exceedes each target preset coordinate axle of predetermined threshold value.If it is determined that target preset coordinate axle be X-axis and Y-axis, it is relatively single
Member 407 then compares angular velocity component of the angular velocity of rotation in X-axis and angular velocity of rotation component of the angular velocity of rotation in Y-axis,
If angular velocity component of the angular velocity of rotation in X-axis is maximum, processing unit 408 is then according to the angular speed direction of X-axis and music
Corresponding target music switching direction is obtained in the corresponding relation of switching direction, if the angular speed direction of X-axis is clockwise,
Corresponding target music switching direction is clockwise, the music in the switching terminal music playlist of execution unit 409 is extremely
Upper one is first, if the angular speed direction of X-axis is counterclockwise, and corresponding target music switching direction is counter clockwise direction, is performed
Music in the switching terminal music playlist of unit 409 to next.
In embodiments of the present invention, terminal can detect that the unlatching of input music application refers to, and respond the open command,
Music application is opened, and enters the terminal music playlist progress music that music is applied, terminal can lead to
The 3-axis acceleration sensor and three-axis gyroscope for crossing terminal built-in detect the angular velocity of rotation and linear velocity of terminal, pass through
Compare the target preset coordinate axle for drawing the angular velocity of rotation maximum that angular velocity of rotation and linear velocity exceed predetermined threshold value,
According to the maximum angular speed direction of target preset coordinate axle of the angular velocity of rotation with the corresponding relation of music switching direction, obtaining
Corresponding target music switching direction is taken, according to the target music switching direction, the music in switching terminal music playlist,
The convenience of music switching is lifted, the interest of user's operation is improved, improves Consumer's Experience.
One of ordinary skill in the art will appreciate that all or part of step in the various methods of above-described embodiment is can
To instruct the hardware of correlation to complete by program, the program can be stored in a computer-readable recording medium, storage
Medium can include:Flash disk, read-only storage (Read-Only Memory, ROM), random access device (Random Access
Memory, RAM), disk or CD etc..
A kind of method and terminal for realizing music switching provided above the embodiment of the present invention is described in detail,
Specific case used herein is set forth to the principle and embodiment of the present invention, and the explanation of above example is to use
Understand the method and its core concept of the present invention in help;Simultaneously for those of ordinary skill in the art, according to the present invention's
Thought, will change in specific embodiments and applications, in summary, and this specification content should not be construed as
Limitation of the present invention.
Claims (10)
1. a kind of method for realizing music switching, it is characterised in that including:
When terminal is in and goes out screen state or holding state, pass through the 3-axis acceleration sensor and three axle tops of the terminal built-in
Spiral shell instrument detects the rotary speed of the terminal, and the rotary speed includes angular velocity of rotation and linear velocity;
The angular velocity of rotation is obtained at the angular velocity of rotation component of each preset coordinate axle and the angle in each preset coordinate axle
Velocity attitude, each preset coordinate axle includes X-axis, Y-axis and Z axis;
Obtain linear velocity component of the linear velocity in each preset coordinate axle;
From each preset coordinate axle, determine angular velocity of rotation component and linear velocity component more than predetermined threshold value
Each target preset coordinate axle;
The angular velocity of rotation component of each target preset coordinate axle is compared, the maximum mesh of angular velocity of rotation component is obtained
Mark preset coordinate axle;
From the corresponding relation of the angular speed direction of default preset coordinate axle and music switching direction, obtain and the anglec of rotation
The corresponding target music switching direction in angular speed direction of the maximum target preset coordinate axle of velocity component;
According to the target music switching direction, the music in switching terminal music playlist.
2. according to the method described in claim 1, it is characterised in that described from each preset coordinate axle, determine rotation
Angular velocity component and linear velocity component include more than each target preset coordinate axle of predetermined threshold value:
For each preset coordinate axle in each preset coordinate axle, judging the angular velocity of rotation component of the preset coordinate axle is
It is no to exceed default angular velocity of rotation component threshold value;If it exceeds default angular velocity of rotation component threshold value, judges the preset coordinate axle
Linear velocity component whether exceed default linear velocity component threshold value, if it exceeds default linear velocity component threshold
Value, it is target preset coordinate axle to determine the preset coordinate axle.
3. the method according to claim any one of 1-2, it is characterised in that described to be added by three axles of the terminal built-in
Velocity sensor and three-axis gyroscope detect before the rotary speed of the terminal that methods described also includes:
The open command of detection input music application;
The open command is responded, the music application is opened, and enters the terminal music of music application and broadcast
Emplace table and carry out music.
4. method according to claim 3, it is characterised in that the target music switching direction is clockwise or inverse
Clockwise.
5. method according to claim 4, it is characterised in that described according to the target music switching direction, switching is eventually
Music in the music playlist of end includes:
If the target music switching direction is clockwise, the music switched in the terminal music playlist is supreme
One is first;
If the target music switching direction is counter clockwise direction, switch the music in the terminal music playlist under
One is first.
6. a kind of terminal, it is characterised in that including:
First detection unit, for when terminal is in and goes out screen state or holding state, being added by three axles of the terminal built-in
Velocity sensor and three-axis gyroscope detect the rotary speed of the terminal, and the rotary speed includes angular velocity of rotation and rotation
Linear velocity;
First acquisition unit, for obtaining the angular velocity of rotation in the angular velocity of rotation component of each preset coordinate axle and described
The angular speed direction of each preset coordinate axle, each preset coordinate axle includes X-axis, Y-axis and Z axis;
Second acquisition unit, for obtaining linear velocity component of the linear velocity in each preset coordinate axle;
Judging unit, for from each preset coordinate axle, determining that angular velocity of rotation component and linear velocity component are equal
More than each target preset coordinate axle of predetermined threshold value;
Comparing unit, for the angular velocity of rotation component of each target preset coordinate axle to be compared, obtains anglec of rotation speed
Spend the maximum target preset coordinate axle of component;
Processing unit, for from the corresponding relation in the angular speed direction of default preset coordinate axle and music switching direction, obtaining
Take target music switching direction corresponding with the angular speed direction for the target preset coordinate axle that the angular velocity of rotation component is maximum;
Execution unit, for according to the target music switching direction, the music in switching terminal music playlist.
7. terminal according to claim 6, it is characterised in that the judging unit includes:
First judgment sub-unit, for for each preset coordinate axle in each preset coordinate axle, judging the preset coordinate
Whether the angular velocity of rotation component of axle exceedes default angular velocity of rotation component threshold value;
Second judgment sub-unit, during for being when the first judgment sub-unit judged result, judges the preset coordinate axle
Whether linear velocity component exceedes default linear velocity component threshold value, if it exceeds default linear velocity component threshold value,
It is target preset coordinate axle to determine the preset coordinate axle.
8. the terminal according to claim any one of 6-7, it is characterised in that the terminal also includes:
Second detection unit, the open command for detecting input music application;
Broadcast unit, for responding the open command, opens the music application, and enter the music application
Terminal music playlist carry out music.
9. terminal according to claim 8, it is characterised in that the target music switching direction is clockwise or inverse
Clockwise.
10. terminal according to claim 9, it is characterised in that the execution unit is used for when target music switching
When direction is clockwise direction, then the music supreme one switched in the terminal music playlist is first;Or, for when described
When target music switching direction is counter clockwise direction, then switch music in the terminal music playlist to next.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410712584.5A CN104460997B (en) | 2014-11-28 | 2014-11-28 | A kind of method and terminal for realizing music switching |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410712584.5A CN104460997B (en) | 2014-11-28 | 2014-11-28 | A kind of method and terminal for realizing music switching |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104460997A CN104460997A (en) | 2015-03-25 |
CN104460997B true CN104460997B (en) | 2017-08-08 |
Family
ID=52907189
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410712584.5A Active CN104460997B (en) | 2014-11-28 | 2014-11-28 | A kind of method and terminal for realizing music switching |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104460997B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105159658A (en) * | 2015-06-30 | 2015-12-16 | 青岛海信移动通信技术股份有限公司 | Signal processing method of intelligent terminal and signal processing device of intelligent terminal |
CN105092891B (en) * | 2015-09-01 | 2019-10-01 | 深圳Tcl数字技术有限公司 | Terminal gets rid of screen recognition methods and device |
CN108762630B (en) * | 2018-04-26 | 2022-04-19 | 努比亚技术有限公司 | Terminal control method, flexible terminal and computer readable storage medium |
CN110381420B (en) * | 2019-07-25 | 2021-11-02 | 深圳智游者科技有限公司 | Control method for switching sound size and music of Bluetooth sound box and related equipment |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101620474A (en) * | 2008-07-04 | 2010-01-06 | 华硕电脑股份有限公司 | Motion-sensing input device of computer system |
CN103472993A (en) * | 2013-09-02 | 2013-12-25 | 小米科技有限责任公司 | Rotation displaying method, device and terminal equipment |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2010218260A (en) * | 2009-03-17 | 2010-09-30 | Sony Corp | Input device, control device, control system, and control method |
-
2014
- 2014-11-28 CN CN201410712584.5A patent/CN104460997B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101620474A (en) * | 2008-07-04 | 2010-01-06 | 华硕电脑股份有限公司 | Motion-sensing input device of computer system |
CN103472993A (en) * | 2013-09-02 | 2013-12-25 | 小米科技有限责任公司 | Rotation displaying method, device and terminal equipment |
Also Published As
Publication number | Publication date |
---|---|
CN104460997A (en) | 2015-03-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104460997B (en) | A kind of method and terminal for realizing music switching | |
CN110147192A (en) | Interface operation method, device, electronic equipment and storage medium | |
CN104685898B (en) | A kind of method and terminal for playing media | |
US20170187865A1 (en) | Terminal Control Method and Apparatus, and Terminal | |
CN104575537B (en) | Music switching method and user equipment | |
CN103645844A (en) | Page displaying method and device | |
CN107562201B (en) | Directional interaction method and device, electronic equipment and storage medium | |
CN103970421B (en) | Method for adjusting on-screen-display patterns of mobile terminal | |
KR102307215B1 (en) | Data processing methods and electronic devices | |
CN103777873B (en) | A kind of information processing method and electronic equipment | |
CN105302407A (en) | Application icon display method and apparatus | |
CN107168539A (en) | A kind of equipment awakening method, device and electronic equipment | |
CN105190509B (en) | Content rotation is provided during scroll actions | |
CN103765367B (en) | Message processing device and information processing method | |
CN104898920B (en) | The method and apparatus of moving in rotation terminal screen picture | |
CN103513788A (en) | Gesture recognition method and system based on gyroscope sensor and mobile terminal | |
WO2016179912A1 (en) | Application program control method and apparatus, and mobile terminal | |
CN105389011A (en) | Display rotation control method and intelligent wearable device | |
CN105242780B (en) | A kind of interaction control method and device | |
CN104166464A (en) | Method, device and portable terminal for controlling panorama display | |
CN104166510B (en) | A kind of method utilizing upset terminal to control to realize terminal device | |
CN108052258A (en) | A kind of processing method of terminal task, Task Processing Unit and mobile terminal | |
CN104750239B (en) | A kind of method and apparatus of the application accessed based on space gesture in terminal device | |
CN107277223A (en) | Adjust the method and its electronic apparatus of event prompt degree | |
CN105378629A (en) | Method and apparatus for controlling automatic rotation of screen, and terminal |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CP01 | Change in the name or title of a patent holder | ||
CP01 | Change in the name or title of a patent holder |
Address after: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18 Patentee after: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP., Ltd. Address before: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18 Patentee before: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP., Ltd. |