added db conversions and new menu into project panel
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
#include "decibel.h"
|
||||
|
||||
decibel::decibel()
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
#ifndef DECIBEL_H
|
||||
#define DECIBEL_H
|
||||
|
||||
/**
|
||||
* @brief Converts an amplitude into a value in decibels
|
||||
*
|
||||
* Converts a 0.0-1.0 amplitude into an infinity-0.0 decibel value
|
||||
*/
|
||||
double amplitude_to_db(double amplitude);
|
||||
|
||||
/**
|
||||
* @brief Converts decibels into an amplitude value
|
||||
*
|
||||
* Converts an infinity-0.0 decibel value into a 0.0-1.0 amplitude
|
||||
*/
|
||||
double db_to_amplitude(double db);
|
||||
|
||||
#endif // DECIBEL_H
|
||||
@@ -20,9 +20,11 @@
|
||||
|
||||
#include "project.h"
|
||||
|
||||
#include <QMenu>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
#include "core.h"
|
||||
#include "widget/menu/menushared.h"
|
||||
#include "widget/projecttoolbar/projecttoolbar.h"
|
||||
|
||||
ProjectPanel::ProjectPanel(QWidget *parent) :
|
||||
@@ -39,6 +41,9 @@ ProjectPanel::ProjectPanel(QWidget *parent) :
|
||||
ProjectToolbar* toolbar = new ProjectToolbar(this);
|
||||
layout->addWidget(toolbar);
|
||||
|
||||
// Make toolbar connections
|
||||
connect(toolbar, SIGNAL(NewClicked()), this, SLOT(ShowNewMenu()));
|
||||
|
||||
// Set up main explorer object
|
||||
explorer_ = new ProjectExplorer(this);
|
||||
layout->addWidget(explorer_);
|
||||
@@ -117,3 +122,12 @@ void ProjectPanel::ItemDoubleClickSlot(Item *item)
|
||||
|
||||
// FIXME: Double click Item should do something
|
||||
}
|
||||
|
||||
void ProjectPanel::ShowNewMenu()
|
||||
{
|
||||
Menu new_menu(this);
|
||||
|
||||
olive::menu_shared.AddItemsForNewMenu(&new_menu);
|
||||
|
||||
new_menu.exec(QCursor::pos());
|
||||
}
|
||||
|
||||
@@ -56,6 +56,8 @@ private:
|
||||
|
||||
private slots:
|
||||
void ItemDoubleClickSlot(Item* item);
|
||||
|
||||
void ShowNewMenu();
|
||||
};
|
||||
|
||||
#endif // PROJECT_PANEL_H
|
||||
|
||||
@@ -42,6 +42,11 @@ Menu::Menu(Menu *menu, const QObject *receiver, const char *member) :
|
||||
}
|
||||
}
|
||||
|
||||
Menu::Menu(QWidget *parent) :
|
||||
QMenu(parent)
|
||||
{
|
||||
}
|
||||
|
||||
QAction *Menu::AddItem(const QString &id,
|
||||
const QObject *receiver,
|
||||
const char *member,
|
||||
|
||||
@@ -58,6 +58,11 @@ public:
|
||||
*/
|
||||
Menu(Menu* bar, const QObject* receiver = nullptr, const char* member = nullptr);
|
||||
|
||||
/**
|
||||
* @brief Construct a popup menu
|
||||
*/
|
||||
Menu(QWidget* parent);
|
||||
|
||||
/**
|
||||
* @brief Create a menu item and add it to this menu
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user