📄 kr_m.c
字号:
/***********************************************************************/
/* File: */
/* Copyright (c) 2000 ZORAN Corporation, All Rights Reserved */
/* THIS IS PROPRIETARY SOURCE CODE OF ZORAN CORPORATION */
/* */
/* =========== */
/* Descripton: */
/* =========== */
/* */
/* Log: */
/* === */
/* $Name: V_1_16 V_1_15 V_1_14 $
/* $Header: v:/dsg/rcs/dsg/vp2k/Customer/menu/zoran/kr_m.c 1.11 2001/08/08 08:25:41 dragonwg Exp $
/* $Log: kr_m.c $
/* Revision 1.11 2001/08/08 08:25:41 dragonwg
/* Revision 1.10 2001/07/10 06:32:38 dragonwg
/* Port the changes from Mushu
/* Revision 1.9 2001/06/06 06:15:08 dingming
/* font 32X24 complile
/* Revision 1.8 2001/03/28 21:09:29 dingming
/* for karaoke recodrinf on DLC
/* Revision 1.7 2001/03/12 10:32:36 leslie
/* Revision 1.6 2000/12/30 02:12:08 tia
/* merge ZCH code
/* Revision 1.7 2000/12/22 07:25:27 adamw
/* Revision 1.6 2000/12/18 08:36:51 dingming
/* Revision 1.5 2000/12/15 14:21:23 dingming
/* support karaoke recording fin flag check
/* Revision 1.4 2000/12/08 09:28:55 dragonwg
/* Recover the cahnge from Adam
/* Revision 1.3 2000/12/08 07:04:50 adamw
/* Revision 1.5 2000/11/20 10:35:05 cliff
/* Revision 1.4 2000/11/17 18:54:13 charlie
/* Use C_FOCUSED
/* Revision 1.3 2000/11/10 03:33:29 charlie
/* Changed MS_display to MS_dialog_display
/* Revision 1.2 2000/11/09 04:07:31 cliff
/***********************************************************************/
// For now, we disable everything
#ifdef KARAOKE_RECORDING
#include <stdio.h>
#include <string.h>
#include "sysdefs.h"
#include "..\..\..\ui\menu_sys\ms_wdgt.h"
#include "..\..\..\ui\menu_sys\ms_lib.h"
#include "..\..\..\ui\menu_sys\osd_drv.h"
#include "..\..\..\decoder\osdrendr.h"
#include "..\..\..\decoder\osdlayou.h"
#ifdef FONT32X24
#include "..\..\..\customer\dragon\strings\strings.h" //DM0605
#else
#include "..\..\..\ui\strings\strings.h"
#endif
#include "menu_var.h"
#include "..\..\..\playcore\ps\ps.h"
#include "..\..\..\playcore\playmode\playmode.h"
#include "..\..\..\playcore\coremain\coregdef.h"
#include "..\..\..\kernel\eventdef.h"
// REMINDER This is not needed if we don't use oHWLimit
#include "..\..\..\Decoder\decoder.h"
#define LAYOUT_WIDTH 720
// Static text positions
// Widget positions
#define SCREEN_WIDTH 504
static const MS_POS screen_pos = {104, MS_LINE_2, SCREEN_WIDTH, MS_MAX_LINES_SMALLMM};
void KRM_EXIT(void); // ZCH DZ0327
#define CHOICE_COLUMN_X 200
#define CHOICE_WIDTH (SCREEN_WIDTH - CHOICE_COLUMN_X)
static const MS_POS mode_choice_pos = {CHOICE_COLUMN_X, MS_LINE_1 ,CHOICE_WIDTH, MS_LINE_HEIGHT};
static const MS_POS times_choice_pos = {CHOICE_COLUMN_X, MS_LINE_2, CHOICE_WIDTH, MS_LINE_HEIGHT};
static const MS_POS quality_choice_pos = {CHOICE_COLUMN_X, MS_LINE_3, CHOICE_WIDTH, MS_LINE_HEIGHT};
static const MS_POS dont_care_pos = {CHOICE_COLUMN_X, MS_LINE_4, 0, 0};
// Karaoke recording mode values
#define KR_MODE_OFF 0
#define KR_MODE_REPEAT 1
#define KR_MODE_RECORD 2
#define KR_MODE_FOLLOW 3
#define KR_MODE_COMPARE 4
// Karaoke recording state bit values
#define KR_STATE_INITIALIZED 0x0001
#define KR_STATE_A_ENTERED 0x0002
#define KR_STATE_B_ENTERED 0x0004
#define KR_STATE_CANCELLED 0x0008
#define KR_STATE_INACTIVE_MASK ~0x000e
#define KR_REPEAT_DEFAULT 3
#define KR_QUALITY_NORMAL 0
#ifndef KARAOKE_RECORDING_GSM //DM0328 different arithmetic for Kar REC
#define KR_QUALITY_MEDIUM 1
#define KR_QUALITY_HIGH 2
#else
#define KR_QUALITY_HIGH 1
#endif
typedef struct _krm
{
int iMode;
int iRepeat;
int iQuality;
WORD wState;
int iTimesToRepeat;
} KRM;
KRM gkrm =
{
KR_MODE_OFF,
KR_REPEAT_DEFAULT,
KR_QUALITY_NORMAL,
0
};
static const MS_STATIC mssMenuTitle = {
{
0,
ALIGN_LEFT,
I_COLOR,
{0, MS_LINE_0, SCREEN_WIDTH, MS_LINE_HEIGHT},
NO_PARENT,
static_user_op,
},
(void *)S_KARAOKE_RECORDING
};
static const MS_STATIC mssKrMode = {
{
0,
ALIGN_LEFT,
I_COLOR,
{16, MS_LINE_1, CHOICE_COLUMN_X, MS_LINE_HEIGHT},
NO_PARENT,
static_user_op,
},
(void *)S_MODE
};
static const MS_STATIC mssTimes = {
{
0,
ALIGN_LEFT,
I_COLOR,
{0, MS_LINE_2, CHOICE_COLUMN_X, MS_LINE_HEIGHT},
NO_PARENT,
static_user_op,
},
(void *)S_TIMES
};
static const MS_STATIC mssQuality = {
{
0,
ALIGN_LEFT,
I_COLOR,
{0, MS_LINE_3, CHOICE_COLUMN_X, MS_LINE_HEIGHT},
NO_PARENT,
static_user_op,
},
(void *)S_QUALITY
};
//
// Mode choice information
//
#define ITEMNUM_KR_MODE_OFF 0
#define ITEMNUM_KR_MODE_REPEAT 1
#define ITEMNUM_KR_MODE_RECORD 2
#define ITEMNUM_KR_MODE_FOLLOW 3
#define ITEMNUM_KR_MODE_COMPARE 4
static const OSD_MESSAGES kr_mode_list_c[] = {
S_OFF,
S_REPEAT,
S_RECORD,
S_FOLLOW,
S_COMPARE
};
const MS_TEXT_LIST kr_mode_list = {
5,(int *) kr_mode_list_c
};
//
// Times choice information
//
#define ITEMNUM_TIMES_1 0
static const OSD_MESSAGES kr_times_list_c[] = {
S_1,
S_2,
S_3,
S_4,
S_5,
S_6,
S_7,
S_8,
S_9
};
static const MS_TEXT_LIST kr_times_list = {
9,(int *)kr_times_list_c
};
//
// Quality choice information
//
#define ITEMNUM_KR_QUALITY_NORMAL 0
#ifndef KARAOKE_RECORDING_GSM //DM0328 different arithmetic for Kar REC
#define ITEMNUM_KR_QUALITY_MEDIUM 1
#define ITEMNUM_KR_QUALITY_HIGH 2
#else
#define ITEMNUM_KR_QUALITY_HIGH 1
#endif
static const OSD_MESSAGES kr_quality_list_c[] = {
S_NORMAL,
#ifndef KARAOKE_RECORDING_GSM //DM0328 different arithmetic for Kar REC
S_MEDIUM,
#endif
S_HIGH
};
const MS_TEXT_LIST kr_quality_list = {
#ifndef KARAOKE_RECORDING_GSM //DM0328 different arithmetic for Kar REC
3,(int *) kr_quality_list_c
#else
2,(int *) kr_quality_list_c
#endif
};
#define PS_UPDATE_PARAM(_update_type_, _value_) \
(void *) ( (((DWORD) (_update_type_)) << 16) | (DWORD) _value_ )
#define PS_UPDATE_PLAYMODE(_value_) \
PS_UPDATE_PARAM( PS_UPDATE_KARAOKE_RECORDING_PLAYMODE, _value_)
#define PS_UPDATE_QUALITY(_value_) \
PS_UPDATE_PARAM( PS_UPDATE_KARAOKE_RECORDING_QUALITY, _value_)
//
// Karaoke Recording menu services
//
//
// Handle a REPEATAB_A event
//
// Returns TRUE if the event was handled,
// Otherwise, FALSE
//
int krm_status_get(void)
{
if(gkrm.iMode != KR_MODE_OFF )
{
if( gkrm.iTimesToRepeat != 0 )
return 1;
else
return 0;
}
else
return 2;
}
BOOL krm_handle_a(void)
{
if ( gkrm.iMode != KR_MODE_OFF )
{
EVENT evt = IE_CORE_UPDATE_PS;
void *param = NULL;
gkrm.wState |= KR_STATE_A_ENTERED;
gkrm.iTimesToRepeat = gkrm.iRepeat;
switch ( gkrm.iMode )
{
case KR_MODE_REPEAT:
break;
case KR_MODE_FOLLOW:
gkrm.iTimesToRepeat += gkrm.iRepeat;
break;
case KR_MODE_COMPARE:
gkrm.iTimesToRepeat += gkrm.iRepeat;
// Fall through
case KR_MODE_RECORD:
param = PS_UPDATE_PLAYMODE( KR_START_RECORDING );
ie_send_ex(evt, param);
break;
}
// Once the A point has been entered, the menu should be closed
if ( g_ui_active_menu_id == KARAOKE_RECORDING_MENU_ID )
{
close_menu();
}
return TRUE;
}
return FALSE;
}
//
// Handle a REPEATAB_B pressed event
//
BOOL krm_handle_b_pressed(void)
{
EVENT evt = IE_CORE_UPDATE_PS;
void *param = NULL;
gkrm.wState |= KR_STATE_B_ENTERED;
switch ( gkrm.iMode )
{
case KR_MODE_REPEAT:
{
}
break;
case KR_MODE_RECORD:
{
#ifdef DISABLE
// REMINDER We can rely on the START event to stop the previous kr mode
param = PS_UPDATE_PLAYMODE( KR_STOP_SPECIAL_PLAYBACK );
ie_send_ex( evt, param );
#endif // DISABLE
param = PS_UPDATE_PLAYMODE( KR_START_RECORDED_AUDIO );
ie_send_ex( evt, param );
}
break;
case KR_MODE_COMPARE:
{
param = PS_UPDATE_PLAYMODE( KR_STOP_SPECIAL_PLAYBACK );
ie_send_ex( evt, param );
}
break;
case KR_MODE_FOLLOW:
{
//<<< ZCH DZ0425 Try to fix Video intermit firsttime in Folllow mode
param = PS_UPDATE_PLAYMODE( KR_STOP_SPECIAL_PLAYBACK );
ie_send_ex( evt, param );
// ZCH DZ0425 End >>>>
}
break;
}
return TRUE;
}
//
// Handle a REPEATAB_B reached event
//
BOOL krm_handle_b_reached(void)
{
EVENT evt = 0;
void *param = NULL;
// If we've repeated the specified number of times,
// cancel RepeatAB
gkrm.iTimesToRepeat--;
if ( gkrm.iTimesToRepeat == 0 )
{
evt = IE_CORE_AB_REPEAT;
ie_send_ex( evt, param );
gkrm.wState &= KR_STATE_INACTIVE_MASK;
return;
}
evt = IE_CORE_UPDATE_PS;
switch ( gkrm.iMode )
{
case KR_MODE_REPEAT:
break;
/* case KR_MODE_RECORD:
{
param = PS_UPDATE_PLAYMODE( KR_START_RECORDED_AUDIO );
ie_send_ex( evt, param );
// Nothing to do ( already handled above )
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -