first commit
This commit is contained in:
266
project/fm_viewer/ui/rm_frame_left.cpp
Normal file
266
project/fm_viewer/ui/rm_frame_left.cpp
Normal file
@@ -0,0 +1,266 @@
|
||||
#include "rm_frame_left.h"
|
||||
#include "rm_frame_bottom.h"
|
||||
#include "../fm_dimensions.h"
|
||||
#include "../fm_app_colors.h"
|
||||
#include "fm_layer.h"
|
||||
#include "rm_frame_video_main.h"
|
||||
#include "rm_frame_graph.h"
|
||||
#include "rm_play_slider.h"
|
||||
#include "rm_frame_eq.h"
|
||||
#include "rm_frame_play.h"
|
||||
#include "rm_button.h"
|
||||
|
||||
#if (TOPDOWN_CH_LAYOUT)
|
||||
#include "rm_frame_video_sub.h"
|
||||
#endif
|
||||
|
||||
#if (RM_MODEL == RM_MODEL_TYPE_TB4000)
|
||||
#include "window_main.h"
|
||||
#endif
|
||||
|
||||
#if (RM_MODEL == RM_MODEL_TYPE_AN6000)
|
||||
#include "fm_daytime.h"
|
||||
#endif
|
||||
|
||||
RMFrameLeft::RMFrameLeft(QWidget *parent) : RMWidgetBase(parent,true)
|
||||
{
|
||||
this->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Preferred);
|
||||
this->setFixedWidth(LEFT_FRAME_WIDTH);
|
||||
|
||||
layout = new QVBoxLayout(this);
|
||||
ZERO_LAYOUT(layout);
|
||||
#if (RM_MODEL_EMT_KR)
|
||||
const int vspace = 2;
|
||||
#else // RM_MODEL_EMT_KR
|
||||
const int vspace = 4;
|
||||
#endif // RM_MODEL_EMT_KR
|
||||
layout->setSpacing(vspace); // 4
|
||||
layout->setAlignment(Qt::AlignTop);
|
||||
|
||||
// Video + Slider
|
||||
createVideoSliderFrame();
|
||||
|
||||
// Graph(SpeedLabel) + EQ Frame
|
||||
createSpeedGraphEQPlayFrame();
|
||||
|
||||
//frameBottom = new RMFrameBottom(this);
|
||||
//layout->addWidget(frameBottom);
|
||||
}
|
||||
void RMFrameLeft::createVideoSliderFrame()
|
||||
{
|
||||
mainVideoFrame = new QWidget(this);
|
||||
layout->addWidget(mainVideoFrame);
|
||||
QVBoxLayout* l = new QVBoxLayout(mainVideoFrame);
|
||||
l->setSpacing(0);
|
||||
l->setMargin(1);
|
||||
mainVideoFrame->setFixedHeight(MAIN_VIDEO_FRAME_HEIGHT);
|
||||
#if (RM_MODEL != RM_MODEL_TYPE_EMT_KR)
|
||||
FMWidgetBorder(mainVideoFrame,"main_video_frame",FM_COLOR_BORDER);
|
||||
#endif //
|
||||
frameMainVideo = new RMFrameVideoMain(mainVideoFrame);
|
||||
l->addWidget(frameMainVideo);
|
||||
|
||||
#if (TOPDOWN_CH_LAYOUT)
|
||||
subVideoFrame = new QWidget(this);
|
||||
layout->addWidget(subVideoFrame);
|
||||
QVBoxLayout* l2 = new QVBoxLayout(subVideoFrame);
|
||||
l2->setSpacing(0);
|
||||
l2->setMargin(1);
|
||||
subVideoFrame->setFixedHeight(MAIN_VIDEO_FRAME_HEIGHT);
|
||||
FMWidgetBorder(subVideoFrame,"main_video_frame",FM_COLOR_BORDER);
|
||||
#endif // #if (TOPDOWN_CH_LAYOUT)
|
||||
|
||||
#if (TOPDOWN_CH_LAYOUT)
|
||||
frameVideoSub = new RMFrameVideoSub(subVideoFrame);
|
||||
l2->addWidget(frameVideoSub);
|
||||
sliderMain = new QWidget(this);
|
||||
#else // TOPDOWN_CH_LAYOUT
|
||||
sliderMain = new QWidget(mainVideoFrame);
|
||||
#endif // TOPDOWN_CH_LAYOUT
|
||||
|
||||
FMWidgetBackground(sliderMain,"slider_frame",FM_COLOR_SLIDER_BACKGROUND);
|
||||
#if (TOPDOWN_CH_LAYOUT)
|
||||
layout->addWidget(sliderMain);
|
||||
#else // TOPDOWN_CH_LAYOUT
|
||||
l->addWidget(sliderMain);
|
||||
#endif // TOPDOWN_CH_LAYOUT
|
||||
|
||||
sliderMain->setFixedHeight(PLAY_SLIDER_HEIGHT);
|
||||
QHBoxLayout* ls = new QHBoxLayout(sliderMain);
|
||||
ZERO_LAYOUT(ls);
|
||||
|
||||
frameSlider = new RMPlaySlider(sliderMain);
|
||||
frameSlider->setFixedHeight(PLAY_SLIDER_HEIGHT);
|
||||
ls->addWidget(frameSlider);
|
||||
frameSlider->setEnabled(false);
|
||||
|
||||
sliderParentLayout = ls;
|
||||
|
||||
|
||||
}
|
||||
void RMFrameLeft::createSpeedGraphEQPlayFrame()
|
||||
{
|
||||
QWidget* w = new QWidget(this);
|
||||
#if (RM_MODEL != RM_MODEL_TYPE_EMT_KR)
|
||||
FMWidgetBackground(w,"3a3a3a",0x3a3a3a);
|
||||
#endif
|
||||
|
||||
// w->setObjectName("test_w");
|
||||
// w->setStyleSheet("QWidget#test_w {border: 1px solid red;}");
|
||||
|
||||
layout->addWidget(w);
|
||||
QVBoxLayout* l = new QVBoxLayout(w);
|
||||
l->setAlignment(Qt::AlignTop);
|
||||
l->setSpacing(0);
|
||||
l->setMargin(1);
|
||||
#if (RM_MODEL == RM_MODEL_TYPE_TB4000)
|
||||
w->setFixedSize(LEFT_FRAME_WIDTH,EQ_FRAME_HEIGHT + PLAY_CONTROL_HEIGHT);
|
||||
#elif (RM_MODEL_EMT_KR)
|
||||
w->setFixedSize(LEFT_FRAME_WIDTH,182+5);
|
||||
#else // RM_MODEL_TYPE_TB4000
|
||||
w->setFixedSize(LEFT_FRAME_WIDTH,182);
|
||||
#endif // RM_MODEL_TYPE_TB4000
|
||||
|
||||
#if (RM_MODEL != RM_MODEL_TYPE_EMT_KR)
|
||||
FMWidgetBorderBackground(w,"border_back",0x3a3a3a,FM_COLOR_BORDER);
|
||||
#endif
|
||||
|
||||
#if (!PLAYER_ONLY_LIBRARY_MODE)
|
||||
#if (RM_MODEL != RM_MODEL_TYPE_TB4000 && !DO_NOT_USE_GRAPH)
|
||||
frameGraph = new RMFrameGraph(w);
|
||||
|
||||
#if (RM_MODEL_EMT_KR)
|
||||
FMWidgetBackground(frameGraph,"graph_back",0x212121);
|
||||
#endif
|
||||
|
||||
|
||||
frameGraph->setFixedHeight(79);
|
||||
l->addWidget(frameGraph);
|
||||
//LAYOUT_DEBUG(frameGraph);
|
||||
#endif // #if (RM_MODEL != RM_MODEL_TYPE_TB4000)
|
||||
#endif // #if (!PLAYER_ONLY_LIBRARY_MODE)
|
||||
|
||||
#if !(DO_NOT_USE_EQ)
|
||||
frameEQ = new RMFrameEQ(w);
|
||||
#if (RM_MODEL == RM_MODEL_TYPE_EMT_KR)
|
||||
FMWidgetBackground(frameEQ,"eq_back",0x212121);
|
||||
#endif // RM_MODEL_TYPE_EMT_KR
|
||||
l->addWidget(frameEQ);
|
||||
#if (RM_MODEL_EMT_KR)
|
||||
frameEQ->setFixedSize(LEFT_FRAME_WIDTH-2,EQ_FRAME_HEIGHT);
|
||||
#else // RM_MODEL_EMT_KR
|
||||
frameEQ->setFixedSize(LEFT_FRAME_WIDTH,EQ_FRAME_HEIGHT);
|
||||
#endif // RM_MODEL_EMT_KR
|
||||
//LAYOUT_DEBUG(frameEQ);
|
||||
#endif // #if !(DO_NOT_USE_EQ)
|
||||
|
||||
#if (RM_MODEL_EMT_KR)
|
||||
l->addSpacerItem(new QSpacerItem(0,2));
|
||||
#endif // RM_MODEL_EMT_KR
|
||||
|
||||
#if (!PLAYER_ONLY_LIBRARY_MODE)
|
||||
framePlay = new RMFramePlay(w);
|
||||
#if (RM_MODEL_EMT_KR)
|
||||
FMWidgetBackground(framePlay,"play_back",0x212121);
|
||||
#endif // RM_MODEL_EMT_KR
|
||||
framePlay->setFixedHeight(PLAY_CONTROL_HEIGHT); //
|
||||
l->addWidget(framePlay);
|
||||
#endif // !PLAYER_ONLY_LIBRARY_MODE
|
||||
|
||||
#if (RM_MODEL == RM_MODEL_TYPE_AN6000)
|
||||
frameDayTime = new FMDayTime(w);
|
||||
l->addWidget(frameDayTime);
|
||||
#endif // RM_MODEL_TYPE_AN6000
|
||||
|
||||
controlParent = w;
|
||||
controlParentLayout = l;
|
||||
}
|
||||
void RMFrameLeft::onAppEvent(RMApp::Event event,int param)
|
||||
{
|
||||
Q_UNUSED(param)
|
||||
if(event == RMApp::WillFullScreen || event == RMApp::WillNormalScreen)
|
||||
{
|
||||
bool bFullScreen = (event == RMApp::WillFullScreen) ? true : false;
|
||||
if(bFullScreen)
|
||||
{
|
||||
_normalControlParentHeight = controlParent->size().height();
|
||||
#if !(DO_NOT_USE_EQ)
|
||||
_eqIndex = controlParentLayout->indexOf(frameEQ);
|
||||
#endif
|
||||
this->setFixedWidth(QWIDGETSIZE_MAX);
|
||||
this->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Preferred);
|
||||
mainVideoFrame->setFixedHeight(QWIDGETSIZE_MAX);
|
||||
mainVideoFrame->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);
|
||||
|
||||
#if (RM_MODEL == RM_MODEL_TYPE_TB4000 && TOPDOWN_CH_LAYOUT)
|
||||
//WindowMain*pw = (WindowMain*)RMApp::instance()->pMainWindow;
|
||||
if(RMApp::mMAXIMIZE) { // pw->mMAXIMIZE
|
||||
subVideoFrame->setFixedHeight(QWIDGETSIZE_MAX);
|
||||
subVideoFrame->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);
|
||||
} else {
|
||||
subVideoFrame->setHidden(true); // 전체화면 모드에서만 사용
|
||||
}
|
||||
#endif // RM_MODEL_TYPE_TB4000
|
||||
|
||||
#if !(DO_NOT_USE_EQ)
|
||||
controlParentLayout->removeWidget(frameEQ);
|
||||
sliderParentLayout->insertWidget(0,frameEQ);
|
||||
#endif // #if !(DO_NOT_USE_EQ)
|
||||
|
||||
#if (RM_MODEL == RM_MODEL_TYPE_TB4000)
|
||||
#if(PLAYER_ONLY_LIBRARY_MODE)
|
||||
// 감추기
|
||||
controlParent->setFixedSize(QWIDGETSIZE_MAX,4);
|
||||
#else // PLAYER_ONLY_LIBRARY_MODE
|
||||
controlParent->setFixedSize(QWIDGETSIZE_MAX,71);
|
||||
#endif
|
||||
#else // RM_MODEL_TYPE_TB4000
|
||||
#if (USE_MAXIMIZE)
|
||||
if(param == 0) {
|
||||
controlParent->setFixedSize(QWIDGETSIZE_MAX,71);
|
||||
} else {
|
||||
controlParent->setFixedSize(QWIDGETSIZE_MAX,182-30);
|
||||
}
|
||||
#else
|
||||
controlParent->setFixedSize(QWIDGETSIZE_MAX,71);
|
||||
#endif
|
||||
#endif // RM_MODEL_TYPE_TB4000
|
||||
|
||||
#if (RM_MODEL == RM_MODEL_TYPE_AN6000)
|
||||
frameDayTime->setHidden(true);
|
||||
#endif //
|
||||
#if (!PLAYER_ONLY_LIBRARY_MODE)
|
||||
framePlay->layout->setAlignment(Qt::AlignCenter);
|
||||
#endif // #if (!PLAYER_ONLY_LIBRARY_MODE)
|
||||
}
|
||||
else // 복원
|
||||
{
|
||||
this->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Preferred);
|
||||
this->setFixedWidth(LEFT_FRAME_WIDTH);
|
||||
mainVideoFrame->setFixedHeight(MAIN_VIDEO_FRAME_HEIGHT);
|
||||
|
||||
#if (RM_MODEL == RM_MODEL_TYPE_TB4000 && TOPDOWN_CH_LAYOUT)
|
||||
subVideoFrame->setHidden(false);
|
||||
subVideoFrame->setFixedHeight(MAIN_VIDEO_FRAME_HEIGHT);
|
||||
#endif // RM_MODEL_TYPE_TB4000
|
||||
|
||||
#if !(DO_NOT_USE_EQ)
|
||||
sliderParentLayout->removeWidget(frameEQ);
|
||||
controlParentLayout->insertWidget(_eqIndex,frameEQ); // 1
|
||||
#endif // #if !(DO_NOT_USE_EQ)
|
||||
controlParent->setFixedSize(LEFT_FRAME_WIDTH,_normalControlParentHeight);
|
||||
#if (!PLAYER_ONLY_LIBRARY_MODE)
|
||||
framePlay->layout->setAlignment(Qt::AlignVCenter);
|
||||
#endif // !PLAYER_ONLY_LIBRARY_MODE
|
||||
|
||||
#if (RM_MODEL == RM_MODEL_TYPE_AN6000)
|
||||
frameDayTime->setHidden(false);
|
||||
#endif //
|
||||
|
||||
}
|
||||
#if (MODEL_BBVIEWER)
|
||||
gpsWidget->setHidden(bFullScreen);
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user