你好,我试图在 qt 上播放音乐,我将点击一个按钮“jouer”来播放音乐,这是我的代码:
#include "jouer.h"
#include "ui_jouer.h"
Jouer::Jouer(QWidget *parent) :
QDialog(parent),
ui(new Ui::Jouer)
{
ui->setupUi(this);
ui->tabmusic->setModel(tmpmusique.afficher()); //show data base
player = new QMediaPlayer(this);
connect(player, &QMediaPlayer::positionChanged, this, &Jouer::on_positionChanged);
connect(player, &QMediaPlayer::durationChanged, this, &Jouer::on_durationChanged);
}
Jouer::~Jouer()
{
delete ui;
}
void Jouer::on_pushButton_3_clicked()
{
close();
}
void Jouer::on_pushButton_2_clicked()
{
jouertemps = new Musiqueavectemps(this); //go to another window
jouertemps->show();
}
void Jouer::on_pushButton_clicked() //that's the playing button where there is the error
{
player->setMedia(QUrl::fromLocalFile("C:\\Users\\Louay\\Desktop\\Music\\1.mp3"));
player->setVolume(50);
player->play();
}
Run Code Online (Sandbox Code Playgroud)
它编译正确,但是当我单击按钮“jouer”(jouer 表示法语中的播放)时,它显示了一个错误,即 DirectShowPlayerService::doRender: Unresolved error code 0x80040266 () 我在互联网上对此类错误进行了一些搜索未解决的错误代码 …
我一直在尝试为一个项目制作一个 CI-CD pipline,我有 2 个后端,一个部署在其上http://141.9*.*****:8800/,另一个部署在其上vps-a******.*******:8800(出于安全原因,某些服务器链接被隐藏)
不管怎样,.env我
REACT_APP_SERVER_URL='http://vps-a******.*******:8800'只有这一行
这就是我的文档文件中的内容
#you have to build the app manually first
# production environment
# pull official base image
FROM node:16-alpine AS node-build
# set working directory
WORKDIR /app
# add `/app/node_modules/.bin` to $PATH
# install app dependencies
COPY package.json ./
COPY package-lock.json ./
RUN npm i --force
#RUN npm install react-scripts@3.4.1 -g --silent
# add app
COPY . ./
RUN npm run build --force
# production environment …Run Code Online (Sandbox Code Playgroud) 我正在将一个项目从 c# 迁移到 java,但 TryGetValue() 方法有问题!
这是 C# 代码:
private static void _AddBadQualityChar (Dictionary<string,List<string>> badQualityChars, string charString, string badQualityChar)
{
List<string> _badQualityChars;
if (!badQualityChars.TryGetValue (charString, out _badQualityChars))
{
_badQualityChars = new List<string> ();
badQualityChars [charString] = _badQualityChars;
}
_badQualityChars.Add (badQualityChar);
}
Run Code Online (Sandbox Code Playgroud)
我不知道 java 地图中 TryGetValue() 方法的等效项是什么,我所能找到的只是 get() 方法,它不返回 Boolean !我怎样才能用Java编写这个函数?