mirror of
https://github.com/game-stop/veejay.git
synced 2025-12-19 14:19:58 +01:00
Initial checkin of veejay 1.4
git-svn-id: svn://code.dyne.org/veejay/trunk@1172 eb8d1916-c9e9-0310-b8de-cf0c9472ead5
This commit is contained in:
69
veejay-current/veejay-client/src/utils.c
Normal file
69
veejay-current/veejay-client/src/utils.c
Normal file
@@ -0,0 +1,69 @@
|
||||
/* Gveejay Reloaded - graphical interface for VeeJay
|
||||
* (C) 2002-2005 Niels Elburg <nelburg@looze.net>
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
#include <config.h>
|
||||
#include <stdio.h>
|
||||
#include <mjpegtools/mpegconsts.h>
|
||||
#include <mjpegtools/mpegtimecode.h>
|
||||
#include <veejay/vjmem.h>
|
||||
#include <string.h>
|
||||
|
||||
int status_to_arr( char *status, int *array )
|
||||
{
|
||||
int n = sscanf(status, "%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d",
|
||||
array + 0,
|
||||
array + 1,
|
||||
array + 2,
|
||||
array + 3,
|
||||
array + 4,
|
||||
array + 5,
|
||||
array + 6,
|
||||
array + 7,
|
||||
array + 8,
|
||||
array + 9,
|
||||
array + 10,
|
||||
array + 11,
|
||||
array + 12,
|
||||
array + 13,
|
||||
array + 14,
|
||||
array + 15,
|
||||
array + 16,
|
||||
array + 17,
|
||||
array + 18,
|
||||
array + 19,
|
||||
array + 20,
|
||||
array + 21,
|
||||
array + 22 );
|
||||
return n;
|
||||
}
|
||||
|
||||
char *format_time(int pos, float fps)
|
||||
{
|
||||
MPEG_timecode_t tc;
|
||||
veejay_memset(&tc, 0,sizeof(MPEG_timecode_t));
|
||||
char *tmp = (char*) vj_malloc( 20 );
|
||||
y4m_ratio_t ratio = mpeg_conform_framerate( fps );
|
||||
int n = mpeg_framerate_code( ratio );
|
||||
|
||||
mpeg_timecode(&tc, pos, n, fps );
|
||||
|
||||
snprintf(tmp, 20, "%2d:%2.2d:%2.2d:%2.2d",
|
||||
tc.h, tc.m, tc.s, tc.f );
|
||||
return tmp;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user